Hi everyone,
I’m working on a PlayCanvas 3D configurator project that involves multiple shed models. Each shed can have different door types that can be installed, removed, and moved along the shed walls using raycasting.
The issue I’m facing is with door placement and movement:
When I move a door across the wall, it sometimes goes partially outside or through the wall, even though I’ve already added collision components to both the door and the wall.
The main problem seems to be that the pivot of the door model is at its center, so when I drag or move it along the wall, it doesn’t properly align with the surface — the door either clips through or floats out of the wall.
What I want to achieve is this:
- When I move the door along any part of the wall, it should stay perfectly flush with the wall surface.
- Both ends of the door should meet the wall edges properly, without the door intersecting or sticking out.
- Ideally, the door should slide or snap along the wall plane, respecting its bounds and preventing it from moving outside the wall area.
I’ve tried tweaking the pivot and using collisions, but the physics don’t seem to prevent the overlap during raycast-driven movement.
Can anyone suggest a clean approach or script logic to ensure that the door:
- Remains constrained within the wall’s bounds, and
- Aligns perfectly with the wall surface while moving?
Would appreciate any ideas, examples, or best practices on how to handle this properly in PlayCanvas — whether through bounding box checks, constraint logic, or local-space alignment.


