Unity 3d Tutorial : How To Check If Target GameObject is Visible in Camera - 2021

Unity 3d Tutorial : How To Check If Target GameObject is Visible in Camera - 2021

Mtir's Code

3 года назад

20,381 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@devarshpatel73
@devarshpatel73 - 11.05.2023 14:25

Bro not to disrespect but what kind of background music is that, I mean it is good but not fitting with the video type, you know what I mean

Ответить
@hardworkerstudio
@hardworkerstudio - 09.01.2023 06:57

Thank you very much!!!

Ответить
@gamoe
@gamoe - 15.12.2022 04:35

thanks you

Ответить
@srkaio7882
@srkaio7882 - 08.11.2022 01:47

you can make scp 173 with this

Ответить
@maddas2128
@maddas2128 - 14.09.2022 02:59

thanks for the song <3
and the awesome video hehe

Ответить
@RedemtionDev
@RedemtionDev - 02.09.2022 10:26

How to make a respawn with this method? 🤔

Ответить
@qpchung1978
@qpchung1978 - 23.08.2022 06:02

Thank you for sharing. I'm trying to do this feature.

Ответить
@andywildsnake7714
@andywildsnake7714 - 01.08.2022 12:15

Works excellent! Thanks a lot!

Ответить
@DwightPotvin
@DwightPotvin - 07.07.2022 20:05

Maybe I am ignorant, but why not just use the OnBecameVisible() and OnBecameInvisible() event functions?

Ответить
@leonidzolotarov5059
@leonidzolotarov5059 - 23.06.2022 01:26

Thanx !!!!

Ответить
@vyperasylum8278
@vyperasylum8278 - 03.05.2022 18:36

public GameObject target;
public Camera cam;

private bool IsVisible(Camera c, GameObject target)
{
var planes = GeometryUtility.CalculateFrustumPlanes(c);
var point = target.transform.position;

foreach (var plane in planes)
{
if (plane.GetDistanceToPoint(point)< 0)
{
return false;
}
}
return true;
}

private void Update ()
{


var targetRender = target.GetComponent<Renderer>();
if (IsVisible(cam,target))
{
//your sentence
}
else
{
//your sentence
}
}

Ответить
@TheRealScinacz
@TheRealScinacz - 28.03.2022 20:08

Thanks you so much! (I couldn't find a better tutorial!)

Ответить
@berkertopaloglu911
@berkertopaloglu911 - 24.03.2022 10:33

i still shows if object behind another object is there a way to prevent that

Ответить
@oknaa8526
@oknaa8526 - 07.03.2022 17:17

yeess simple and to the point ! thanks aloot

Ответить
@damurlive
@damurlive - 16.11.2021 11:40

Thanks for the tutorial.
how about when i want to hide an object. Lets say i want to hide tree, grass, or any else. Should i create more "public GameObject target;" ?

Ответить
@3d_nahla289
@3d_nahla289 - 07.11.2021 00:56

please other tut about third person with camera and game object target

Ответить
@markcristianibe8131
@markcristianibe8131 - 05.10.2021 17:16

It can still detect even the target object was blocked by other objects

Ответить
@vipertheguy8529
@vipertheguy8529 - 28.06.2021 13:18

Thanks, helped me so much! have a great day.

Ответить
@alperaydin4528
@alperaydin4528 - 06.06.2021 21:18

Very Good

Ответить