Support Forum

Blocking the way without considering as an obstackle

I’m making 2d top down game and using Ai Lerp. I have a narrow way which’s size (width) is 1 node. But on that way i have a gate. Is there any way to block player but without putting that gate on Obstackle layer? So player will generate path throw that gate and doesnt consider gate as an obstackle but he can’t pass gate and keeps colliding with it?

i tried to add rigidbody and collider to player and collider to gate but it keeps going throw the gate

Hi

AILerp does not use physics in any way, it will completely ignore the rest of the world. Maybe you want to use the AIPath component instead.

See https://arongranberg.com/astar/docs/movementscripts.html for more info.