playMaker

Author Topic: Make player invisible to an enemy's raycast behind tall grass  (Read 1902 times)

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Hi,

As the subject line reads I want to make the player (first person) invisible to an enemy's raycast (vision) behind tall grass. I have the enemy raycasting set up and all is working, accept he can see me through thick high grass.
There are probably simple solutions. Something invisible over the patches of grass that blocks the raycast?

Thanks in anticipation. Charles

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Make player invisible to an enemy's raycast behind tall grass
« Reply #1 on: July 01, 2017, 05:44:41 AM »
Hi, does the grass have a collider?
if not you can make it by using (for example) a cube, resize it to the grass size and then disable or remove the mesh filter and Mesh renderer.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Make player invisible to an enemy's raycast behind tall grass
« Reply #2 on: July 02, 2017, 04:11:43 AM »
Hey DjayDino,

I haven't put a cube over a section of grass, just tested with a cube and while the enemy doesn't see me if I am behind the cube it's collider blocks me when I would want to enter it's volume (to go into the grass to hide).

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Make player invisible to an enemy's raycast behind tall grass
« Reply #3 on: July 02, 2017, 04:31:55 AM »
Hi.
Check 'is trigger' on the Collider component.

unearthly

  • Junior Playmaker
  • **
  • Posts: 62
Re: Make player invisible to an enemy's raycast behind tall grass
« Reply #4 on: July 03, 2017, 05:34:20 AM »
Thanks again DjayDino.

Sometimes the answer is so simple it's astonishing :-[

This one is solved.