You can:
- For a sliding door: when triggered, you’ll need to match the controller’s world location to the door’s relative location, then you need to shoot a line from the translated position of the controller to the door to tell it to move parallel in X.
Basically:
- Point A is ( 0, 0, 0 ) relative to your door.
- Point B is the VR controller relative to the door.
- You need to find line c.
- Draw line a or draw line b to get point C (already a given if you found point B)
- And finally set door’s X to point C
You can limit the door’s movement by clamping the C point.
- Or…
- Door relative X = map ranged clamped ( cube relative X )
You’ve found line b and set point C.