Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: TrentSterling on September 21, 2014, 10:01:26 AM
-
(http://i.imgur.com/zUFyofz.gif)
GameObject.renderer.isVisible doesn't work when an object casts dynamic shadows. This makes the GameObjectIsVisible action useless in any application with shadows enabled.
Here's a replacement action that test's if the object's renderer bounds are within the Main camera's frustum planes.
(http://i.imgur.com/dSj1d8d.png)
Based off a code snippet from here:
http://forum.unity3d.com/threads/is-target-in-view-frustum.86136/#post-626470
EDIT: I misspelled Frustum everywhere. It's not 'Frustrum' ha. Uploaded corrected class name and whatnot. God I feel dumb for that. Shoulda just called it viewport. Would have saved myself from the endless corrections here and my site and on youtube.
-
i was looking for the same
-
Nice one! Should go in the ecosystem imo.
-
Hi,
It's on the Ecosystem now
(https://pbs.twimg.com/media/CRcW-LxXIAAR56A.png)
Bye,
Jean
-
Very nice! Thanks!
-
Thanks for that!
-
Hey guys,
can some of the more experienced programmers take a look at this action, it's creating a lot of GC?
-
Hi,
This action is on the Ecosystem (IsVisibleInCameraFrustrum). I just updated it to remove as much GC as possible, it will be even better starting 2017.3 as Unity made a GC free version of the frustrum planes api command.
So update the action from the ecosystem and use that one instead of the one attached to the first post of this thread.
Let me know if you see an improvement.
Bye,
Jean
-
Thanks Jean, works great, 0.0kb of garbage :)
-
(http://i.imgur.com/zUFyofz.gif)
GameObject.renderer.isVisible doesn't work when an object casts dynamic shadows. This makes the GameObjectIsVisible action useless in any application with shadows enabled.
Here's a replacement action that test's if the object's renderer bounds are within the Main camera's frustum planes.
(http://i.imgur.com/dSj1d8d.png)
Based off a code snippet from here:
http://forum.unity3d.com/threads/is-target-in-view-frustum.86136/#post-626470
EDIT: I misspelled Frustum everywhere. It's not 'Frustrum' ha. Uploaded corrected class name and whatnot. God I feel dumb for that. Shoulda just called it viewport. Would have saved myself from the endless corrections here and my site and on youtube.
Hi thank you. What about objects behind a wall? can it still be seen?