Hey! Not sure if that is still relevant, but I made a simple sliding door graph that u might find useful.
It is purely local, and made to only move the door only on the local Z axis (you can rotate the parent game object to rotate the door though!
Here’s a little gif:
There isn’t too much to it and I added comments, but basically the flow goes like this:
- Save the current door offset relative to its parent
- Save the current handle offset relative to the door
- Start tracking the handle movement
- Get current handle’s
- Offset it by the initial handle’s position to calculate the actual distance it was moved on the Z axis
- Clamp (limit) the values by the maxMoveLeft and maxMoveRight
- Get the current door’s
- Add the clamped z offset of the handle to the z offset of the door
- Set the new door position
- Reset the handle back to where it should be (the fake handle position that always moves with the door
- Stop tracking the handle movement
Here’s a full setup with the example scene and the graph you can use
Hope it helps!