Help With raycasts!

OK OK, I know this is like my 1003102390128939 post on here but that’s what the forums are all about right?

So I’m trying to make an effect similar to Super Animal Royale, where when my enemies are out of sight they are hidden (So you can’t see through walls) This is my current setup :

who would have guessed it doesn’t work! :partying_face:

It hides them just fine but they never show up again.
my debugging says the variable that is responsible for them hiding and showing never switches to showing. So can you not invert raycast conditions?

I have another question, can you use groups for the objects you test and how do you know which object was found?

Ray cast doesn’t invert like most conditions. When inverted it picks the furthest object instead of the closest. I think you can put it into a not condition but it’s just as easy to do the following

Action: Set a boolean like IsWall to false

Then use the ray cast to test against the obstacles like walls from player to enemy
Acton : set boolean IsWall to true

If it’s false there is no wall, true there is a wall.

1 Like