Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: createasaurus on April 06, 2014, 03:47:22 PM
-
During gameplay, I need to know where my player is when he goes behind the level geometry and is hidden. Other games sometimes have an outline, shadow, GUI arrow, or something that tracks a hidden player. See example images of what I'm after. My game is actually very similar to these sample images, just so you know what I'm hoping for.
(http://)
Any advice at all will be greatly appreciated. Thank you!
-
You could fire a ray from the camera to the player and see if it hits collision.
There is a GameObject is visible action but I don't think it works like this (could be wrong)
-
Thanks LampRabbit!
I will attempt to implement. It is my first time using a ray, so wish me luck!
It seems the basic idea should be: if camera ray dose not hit player, then toggle player outline layer on.
-
Basically yes, but remember that raycasts can get very expensive. So you might look at rasting a ray every 30 frames (for example) rather than everyframe as this feature isn't critical (I assume)