How to get the Transform of main player? I need to parent it to a moving platform

The description of the feature:
when the main player walk into a moving platform, the player will be parented to the platform and will move synchronously with it.

My plan:
To do this, I need to get the Object or the Transform of the main player, and use SetParent(platform.Transform) in Udon Graph.

The problem is, I don’t know how to get the main player Object or Transform. So if someone know it, plz help me out, or teach me another way to parent objects.

thank you very much.

We can’t get the player transform, only the position data and rotation.

So you’ll have to use either stations, teleport, or set velocity, to move the player around.

Thanks for your reply, seems station is the only way … maybe I have to give up free move on the platform.

Superbstingray figured out a solution recently with some wizardry in Udon Graph. GitHub - Superbstingray/UdonPlayerPlatformHook: Prefab to make players follow moving colliders cor

1 Like

I love u, u r my hero. This prefab is exactly what I want, thank u sooooo much.