VRCObjectSync doesn't sync Gravity/Kinematic flags reliably
tracked
Reimajo
Gravity and Kinematic flags on
VRCObjectSync
components don't sync correctly right now and also cannot be set correctly while holding the pickup.To set gravity or kinematic flags, VRChat added two new methods for us: https://udonsharp.docs.vrchat.com/vrchat-api/#vrcobjectsync (they are supposed to behave like a synced variable)
There are two bugs related to this:
~
Bug 1:
~All you need is to create a pickup that has no gravity and then toggle the gravity flag on the
VRCObjectSync
component with an external button after claiming ownership. Then you let different people in the world pick up the pickup and drop it (to show their own local state). In my tests, this resulted in a pickup where the gravity flag is wildly different on each client and only syncs occasionally or not at all. They would see the pickup drop on my end, but when they pick it up it has no gravity for them.~
Bug 2:
~All you need is to create a pickup that has no gravity and then toggle the gravity flag on the
VRCObjectSync
component in OnPickupUseDown()
. In my tests, this resulted in a pickup where the gravity stays enabled after the first OnPickupUseDown()
and I am unable to turn gravity off again. To check gravity, the pickup is dropped.You can also just test it out here:
Right setup: Bug 1 / Left setup: Bug 2
Additional note: Since we only got a setter and not a getter method, we are left in the dark here when it comes to analyzing the problem. Reading out the local rigidbody state doesn't give us access to the real synced state. A getter method should be added.
Log In
Fax
tracked
Thank you for reporting the issue!
S
Selle_
Had a lot of problems in the past with gravity/kinematic sync and didn't really know what was going on. Looks like this is the cause of it, ty for posting it!
DrakenStark
You're not alone in finding this issue! I have objects that need to appear as if they were destroyed, freezing in place, but when they respawn gravity doesn't reliably get restored as it should every time. No ownership issues since everyone receives the network call for it. Works only 95% of the time, but when it breaks it's really obvious and comes across as I'm crazy for trusting ObjectSync's gravity and/or kinetic syncing. Since making and toggling the script of my own local only gravity via a Force on a FixedUpdate(), the issue went away. ObjectSync still works like a charm with only the Network Owner having local gravity enabled. I imagine this isn't feasible or ideal for most scenarios though as there's a much larger performance impact in doing so, but this also felt like it proved something is wrong/unreliable with ObjectSync.