cryptomax
cryptomax6mo ago

Does Realtime transform work differently on a 2D rigidbody vs a 3D rigidbody?

I'm having an issue where it seems like the rigidbody has no velocity when being moved by the realtime transform on the remote client.
13 Replies
kapa.ai
kapa.ai6mo ago
Hi @cryptomax. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The knowledge sources provided do not specify how RealtimeTransform behaves differently between 2D and 3D Rigidbodies in Unity. However, it's important to note that RealtimeTransform does synchronize the position and rotation properties of the Rigidbody, which are in world space instead of local space. This is because PhysX, Unity's physics engine, simulates all rigidbodies in world space. If you're experiencing issues with the velocity of the Rigidbody, it might be related to the syncVelocity property of the RealtimeTransform. If syncVelocity is true, the rigidbody on this transform will sync its velocity with the model. If false, the velocity will be derived on remote clients from the position updates. Deriving the velocity saves bandwidth but is less accurate. For more detailed information, you might want to check the RealtimeTransform documentation (https://normcore.io/documentation/realtime/realtimetransform) and the Networked Physics guide (https://normcore.io/documentation/realtime/networked-physics). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@401986039964631060> kapa.ai is still learning and improving, please let us know how it did by reacting below
cryptomax
cryptomaxOP6mo ago
ah it must be that if it's 2D it only syncs the transform, that would explain what i'm seeing @Normcore Assistant realtimeTransform has a sync velocity property I can set?
kapa.ai
kapa.ai6mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Yes, RealtimeTransform does have a syncVelocity property. However, it's important to note that this property is read-only, meaning you can't set it directly. Here's what the syncVelocity property does according to the documentation (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeTransform): - If syncVelocity is true, the rigidbody on this transform will sync its velocity with the model. - If syncVelocity is false, the velocity will be derived on remote clients from the position updates. Deriving the velocity saves bandwidth but is less accurate. So, while you can't directly set the syncVelocity property, it's behavior is determined by the state of the rigidbody and the RealtimeTransform component. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@401986039964631060> kapa.ai is still learning and improving, please let us know how it did by reacting below
cryptomax
cryptomaxOP6mo ago
I guess I will just compute a velocity from the syncing transform to use this on the remote client
Camobiwon
Camobiwon6mo ago
RealtimeTransformRigidbody only works on normal rigid bodies (3D)
cryptomax
cryptomaxOP6mo ago
apparently so, for some reason I just assumed it would handle the 2D rigidbody as well
Camobiwon
Camobiwon6mo ago
Totally different API, I imagine it'd kinda suck to co-develop haha
cryptomax
cryptomaxOP6mo ago
I'm surprised 2D makers haven't requested one that syncs 2D RB, but, maybe nobody is really using it for that this is a 2d rb in my 3D game in this case
Camobiwon
Camobiwon6mo ago
If it got enough demand I feel it could make sense
liamc
liamc6mo ago
You could pretty easily write a realtime transform clone with support for the 2D RBs. There's no reason it shouldn't work almost identically AFAIK, you just need to swap out the components and properties for the 2d versions.
cryptomax
cryptomaxOP6mo ago
did we already have a feature request for the source scritps to be released publicity so we dont have to decompile?