Allow parenting objects to player bones, player position and player tracking data
Reimajo
Since bone transforms aren't exposed, we can't parent objects to players and need to use expensive and complicated update loops for such a basic task, which also results in ugly/janky object movements and low performance.
Please give us a simple function like .SetParent(Transform t, Boolean b) for .GetTrackingData(VRCPlayerApi.TrackingDataType.x) and .GetBonePosition(HumanBodyBones.x) and for VRCPlayerApi.GetPosition
Log In
DrakenStark
Any kind of function to create an exposed dummy object that is parented accordingly would be amazing. Any support for this would go a long way to enabling better hitboxes, custom HUDs, and one less hoop to jump through for some shader effects.
As is for OnPlayerEnterTrigger events, the local player has a full capsule, while non-local players seem to have a sphere that only goes up to their waist. There's a necessity to work around this with custom hitboxes for projectile collision, which raycasting is not always ideal for. Player based object parenting would go a long way to work around this, while also allowing for more flexibility with head, limb, and finger detection.
Please add this capability to VRChat/Udon/UdonSharp! It's been years of high performance Update() function demand for FPS related worlds that could be significantly cleaned up through more native support in Unity with child objects or constraints. Only one dummy object needs to exist (via a function for on-demand creation of them) for each of whatever bone or tracking item that is sought to tie things into.
bd_
If there are concerns about directly exposing player bones to Udon (where Udon scripts could potentially pose the player's avatar, for example), other options include e.g.:
- Creating a proxy transform parented to the bone, and exposing that transform (only) to Udon (note that this risks destroying world objects on avatar unload, possibly this should reparent any children of the proxy to the scene root before unload)
- Adding an API to link a constraint on a world object to a player bone transform
LunaDelrey
+1, and I'm surprised that after a year there hasn't been any feedback on this yet. I've been trying to attach things to players with udon, and the syncing of things just isn't optimal, both client and server side.
Add to that the fact that bone rotation can be even more janky and a direct parent to the bones would honestly solve all of this jank.