playMaker

Author Topic: Need player outline / shadow, when hidden behind geometry [Solved]  (Read 2208 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
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.


Any advice at all will be greatly appreciated.  Thank you!
« Last Edit: April 09, 2014, 09:17:58 PM by createasaurus »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Need player outline / shadow, when hidden behind geometry
« Reply #1 on: April 06, 2014, 08:33:02 PM »
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)
« Last Edit: April 06, 2014, 08:35:19 PM by LampRabbit »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Need player outline / shadow, when hidden behind geometry
« Reply #2 on: April 07, 2014, 09:52:36 AM »
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.
« Last Edit: April 09, 2014, 09:18:27 PM by createasaurus »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Need player outline / shadow, when hidden behind geometry
« Reply #3 on: April 07, 2014, 05:13:13 PM »
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)