Unsure why raycast modifier doesn't seem to be working

Hey there, I’ve been working on a project where enemies can only move in a single direction at a time, so I figured I’d want to get that direction using the raycast modifier, so I’ve been trying to get it to work, but the path it generates always seems to be the same as without it, does it seem like I’m missing something here?
I’ve made sure the raycast mask doesn’t include the npcs themselves.


You are using a thick raycast. Most likely, your raycast is hitting the ground every frame, preventing it from simplifying any part of the path.

If you have the pro version, I recommend using graph raycasting instead.

Hey, would it still do that even if the ground isn’t included in the layer mask?
I see a slight improvement with the graph raycast, but I feel like I’d prefer the thick raycast for my purpose if it’s possible.

Actually, it looks like your graph has a lot of breaks in the graph due to height differences. But it’s kinda hard to see from the top-down view. That will probably obstruct the raycast modifier if you use graph raycasting.

Oh, I figured out the issue I was having, I was getting the values from the path instead of the vectorpath after it was finished optimizing.

1 Like