My RayCast Is not Working

I’m using Boids for my zombies so they can’t use pathfinding but I want to use pathfinding, SOOO I came up with an object that has so many conditions and moves around the map to make the zombies follow me. And I wanted to add a feature where if the nearest zombie is behind a wall the pathfinder will go to it and then make it follow it around the wall. My problem is I’m shooting a ray from the player to the nearest zombie and it tests against the walls. But it looks like it’s sticking to the walls. I think the problem is either my drawer is updating slowly or the ray cast and it’s trying to interpolate between the old and new positions. How do I make my ray cast or drawer update faster?

Edit: My RayCast Is not Working - #5 by catdog5100

I’m not sure on your concept so maybe this won’t do what you want but you can use the Pathfinder and boids on the same object just not at the same time. If you deactive the Pathfinder at the beginning then when needed, you can disable the boids and enable the Pathfinder.

I used an existing tile object with the Pathfinder and boids behaviors. I haven’t used boids much. So, I’m not positive on how to control them but this made them move.

When the button was clicked, it picked the nearest tile and moved it to 0,0. It checked for the boids behavior being active first, so it wouldn’t pick one that had already been switched to Pathfinder.

1 Like

Interesting ill test it around a little bit…

This sounds like a pathfinding issue, not raycast.

When I said sticking to walls I mean the drawer that is on the ray not the zombies.

You are casting against the wall so I think it is supposed to…