How would I make a sliding door?

I have been playing around with Unity and VRC. I was wondering if it is possible to make a sliding door without animations and UDON? For example, a player uses interaction to fully pull the sliding door open?

I have been using Rigidbodies, VRC Pickup, and parent constraint but it seems to only pick up the door? Any ideas around this?

How about an invisible pickup, that’s shaped like the door handle? Players would grip the pickup and move it however they wish. You then move the sliding door via Udon (by checking the pickup’s position, or maybe with a constraint

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:

ezgif.com-gif-maker (10)

The graph

There isn’t too much to it and I added comments, but basically the flow goes like this:

On Start:

  • Save the current door offset relative to its parent
  • Save the current handle offset relative to the door

On Pickup:

  • Start tracking the handle movement

On PostLateUpdate:

  • Get current handle’s localPosition.z
  • 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 localPosition
  • Add the clamped z offset of the handle to the z offset of the door
  • Set the new door position

On Drop:

  • 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!

I would like to thank you so much for this! I like looking at this graph as it allows me to deconstruct which parts interact with what instead of figure out what needs to be connected to what. This helps so much!

2 Likes