Hey, so I’m using raycast to give Zombies the ability to detect if the player is infront of them. I am shooting a racast from the Zombie’s Root to the Player’s Root to do this, and if the distance is close enough then it returns true (Plr is infront of Zombie) or false (Plr is not infront of Zombie). This works great but I need to lock the Y axis for this next thing I’m trying to do.
This is how it runs currently, the ray shoots out from the Zombie straight at the player.
And when the player moves up a level, it changes directions.
However I do not want that second bit, I need to lock the Y axis for the raycast somehow so it still points straight like this.
I still need the ray to FOLLOW the player but I don’t want it to point up or down if the player had for example went up some stairs, or down them.
Any help on how I could accomplish this would be greatly appreciated.


