Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: izzycoding on May 19, 2013, 09:37:15 AM
-
Hi,
I have a scene where I need to be able to detect when an object is out of view.
For example, my character throws a bouncy ball, when the ball goes out of view I want the FSM to detect this and destroy its self.
Is there anything that can do this for me?
I was previously using a script in the OnBecameInvisible function to detect this.
Any ideas would be great.
Regards,
-
Playmaker has a built in system event: BECAME INVISIBLE.
This is fired by the OnBecameInvisible event. So it's equivalent to what you were doing before.
Use this event in a global transition to activate a state and run actions when the GameObject becomes invisible.
Note: Unity uses ALL cameras to determine visibility, including the Scene View camera! Take this into account when testing!
-
Hi,
That is great, where do i find that? As I cant see it anywhere.
Currently I only have a single camera in my scene so that should be fine.
Regards,
-
When you right click on a state to add a transition you can drill down to System Events.
See attached image.
-
Hi,
Great thanks, I knew it would be something simple.
:-) I was looking for an Action for this....lol
Regards,
-
Hi,
I have replaced my playmaker stuff to use the system event.
I have only 1 camera in my scene but this event never triggers the BecameInvisible State.
Am I doing something wrong here?
Regards,
-
Hi,
Read the comments above, basically, I think you are confused with a unity bug, where the object also must be out of the "scene" view in editor,
I tested and works fine, so make sure that the object is actually not still visible on the scene, else it will not fire.
bye,
Jean
-
There's a little history on that here:
http://hutonggames.com/playmakerforum/index.php?topic=3825.0