VRC Position and Parent Constraints Are Briefly Displaced Incorrectly When Toggling Off "Freeze To World"
closed
V1X3L
For the last few versions of the game and the SDK (confirmed to still exist as of SDK version 3.8.2, and game build 1664), the VRC Position and Parent Constraints behave strangely when toggling the "Freeze To World" setting with animations.
When toggling the setting on, there is no abnormal behaviour, but when toggling the setting off again, the constraint's position is set to double the distance moved since the setting was last enabled, before correcting itself almost immediately, and moving to the source element it is constrained to. This is not too much of an issue for the local user, but if the incorrect movement of the constraint is moved outside of the field of view of a remote player, its position will not be corrected until they look at the position it was incorrectly moved to first.
To give a specific example, since the issue is somewhat hard to describe, the core of my issue is that the entire mesh of my avatar is dependent on the position of a VRC Position Constraint. Say that I begin at the world origin, with "Freeze To World" enabled, and I walk 10m away from the world origin. When I disable the "Freeze To World" setting, my avatar will briefly appear as though it teleports 10m away from me in the same direction I had just moved (and therefore 20m from the world origin), before almost instantly teleporting back to my actual position (where the source element it is constrained to is located). However, if a remote player is looking at me, facing the world origin (and therefore facing away from where it is incorrectly displaced to), they will report that my avatar has disappeared. The avatar will stay invisible to them until they look at where the constraint was incorrectly displaced to, at which point they will report that my avatar is back where it should be.
I assume this issue is caused by the position of constraints not being updated when they are not in view, but I have found no workaround to this issue which prevents the incorrect displacement.
Thank you for your time, and let me know if you need any more information!
Log In
Dexvoid
closed
Dexvoid
needs more information
This post was marked as
tracked
Dexvoid
needs more information
Please can you share the ID of the avatar you're referring to?
V1X3L
Dexvoid Sure thing!
Here is the avatar I was using in my testing of the issue:
Turning on the "Toggle Smooth Movement" toggle in the radial menu is what causes the issue. So each time it is turned on, the model is moved double the distance since the last time it was turned on. The only thing that the animation started by the toggle does is toggling "Freeze to world" on and off on a position constraint.
Dexvoid
V1X3L Thanks very much for providing this avatar.
This issue seems to be specific to this avatar - so far, I haven't been able to find any faults with the constraints system itself affecting this avatar.
I can see that the WorldConstraint game object at the root of your avatar containing the frozen/unfrozen position constraint has a child parent constraint that is briefly enabled for one frame only every few frames. If this parent constraint is inactive at the time you unfreeze the parent position constraint, it won't shift back to follow the Reset transform at this avatar's "real" feet until the frame where the parent constraint next gets flicked on. I believe this is what's causing the effect you're seeing.
Making sure the parent constraint is enabled on the same frame the position constraint is unfrozen should solve the issue, although that could be challenging depending on your setup. As a possible alternative, you could also try moving Container one level up to the avatar root, removing your WorldConstraint game object entirely, and then having your animator flick Freeze To World on and off every few frames while Toggle Smooth Movement is off, keeping it switched off permanently for as long as Toggle Smooth Movement is on. That should give you the same effect as before without this timing issue between two constraints if I've understood the avatar correctly.
The issue you mention with remote players not seeing you is probably due to animator culling since the constraint is moving your entire visible mesh around. The above suggestions might fix that as well, but if not you may need to make sure the constraint is unfrozen while your animator is disabled so the avatar's mesh stays with its root while users aren't looking. There's an IsAnimatorEnabled parameter that you could use for this: https://creators.vrchat.com/avatars/animator-parameters/#built-in-parameters
Going to switch this back to Needs More Info for now as I can't find any faults with the constraints system on this avatar from our side - feel free to try out the above and reply here if there are still issues.
V1X3L
Dexvoid Thanks so much for the extra info
I've just tested it with one of the suggestions you made and that resolved it! Makes sense in hindsight that it would be causing the issue, I'm not sure how I didn't try that out when doing all the troubleshooting I was trying before. But that's how troubleshooting goes sometimes haha.
Thank you very much for your time and assistance with the issue, I greatly appreciate it!