Animations with udon

Im setting up a world with a door to a bathroom.

I need the door to open and close when interacted with, i think i have set up basic nodes but i still have no idea of how to use animations with udon.

Please help!

I was making the same thing last night, however my door doesn’t ‘animate’ open, it just becomes open by a one time rotation. So here’s that code if it helps you, or at least gives you something to start from.
I have 4 objects, the door itself, 2 handles and an empty game object that is the pivot point. The code itself is set on the door itself. Its also setup for being a global thing, so if one player opens it, everyone should see that. On that note, network event doesn’t seem to trigger while you’re using it in the editor, so you may have to upload this to vrc to see it working.
First the event that is sent to everyone:

Second, the flip logic:

Third, the actual rotations happening on the objects:

Finally, drop the objects in the public variables, drop the door itself in the DoorU spot, as it references itself, doesn’t seem to work without.

Now that I think about it though, I could use time to set the angle and it should ‘animate’ open and close. So there’s that.
Good Luck!

What about using the rigid body system?

  1. Rigidbody Add Torque / Set Angular Velocity to get things moving
  2. Rigidbody Get Rotation to test for angular position stop point
  3. Rigidbody Set Velocity to zero to stop

I haven’t tested this