Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Hasuman on June 30, 2019, 12:18:28 PM
-
What would be the most effective way to check whether a thing is currently on screen? Basically for my sidescrolling game I want defeated enemies to explode if they hit the edge of the screen. It should also take FOV in consideration since it changes depending on the situation and player's action. I hope it's not too complicated to create.
-
Hi.
If they should be still visible and on the edge of the screen, i think i would place some triggers as child on the camera on the edges or near the edges.
these triggers can set a bool to true when object is inside the trigger and to false when not anymore inside trigger.
then something similar for the fov, if inside fov set bool true if not false.
Then have a bool all true to check if both are true, if both true....BOOM! :)
-
That's the general idea. Parenting trigger boxes around to the camera is the easy part. I just don't really know how to make it handle the FOV detection. The dream scenario would be to simply have a simple box that grows and shrinks with the FOV and nothing else.
I'll keep experimenting. In my game it's not important to be pixel perfect detection anyway, so maybe I can find a similar solution from simpler methods.
-
Hi.
Maybe this video can help :
-
Hi,
There are few actions for this on the Ecosystem, like IsVisibleInCameraFrustrum
Bye,
Jean