Wall Collision

I’m trying to recreate same feature inside Unity like in this reference video:

Basically, I have game objects that I’m moving with mouse movement (no rigid bodies), once I detect wall, I want to apply the normal vector to affect the direction and stop moving the game object through walls.
What is the best way to create this?

Thanks!

Just use BoxCast etc. to see how far you can safely move the object without hitting anything. The RaycastHit.distance property will tell you the maximum amount you can move the object.

1 Like

Hey Thanks for your response I will try it out!