Wall Collision

Hey,

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

Basically, I have entities 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 entity through walls.
What is the best way to create this?

Thanks!

I would use bounding boxes and raycasts like this example: Simple shape raycasting | Learn PlayCanvas

One box for each wall and floor, then you can use raycasting to place the object and work out where the walls are.

1 Like

Thanks I will try it today!