cryptomax
cryptomax2mo ago

Constant force syncing

So if you have a constant force that is being applied to an object, Should you bother trying to sync turning it on and off between players or does it not matter because whoever owns it will simply control the rigidbody behavior anyway.
Solution:
no need to sync the extra force then
Jump to solution
5 Replies
kapa.ai
kapa.ai2mo 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: ---------------------- In NormalVR's system, the concept of ownership is crucial. The client that owns an object is treated as the source of truth for that object's state. This means that if you have a constant force being applied to an object, the client that owns the object will control the Rigidbody behavior. When operating in Rigidbody mode, RealtimeTransform synchronizes the world position and rotation values in addition to all Rigidbody settings. This is because Unity's physics engine (PhysX) works entirely in world space. When a Rigidbody RealtimeTransform collides with a second Rigidbody RealtimeTransform, it will attempt to request ownership of this second object as well, so the same client can simulate both of the objects in the collision. Therefore, if the force being applied to the object is affecting the Rigidbody, it would be controlled by the owner of the object. If you want to change the behavior of the object, you would need to request ownership of the object and then make the changes. Here is how you can request ownership of a RealtimeTransform component:
RequestOwnership()
RequestOwnership()
You can call this function or use the Request Ownership button in the editor inspector. After RequestOwnership() is called, the RealtimeTransform is available for immediate use. Normcore will assume the call is going to succeed, and will roll back any state changes automatically if the call is rejected by the server. So, to answer your question, you should not need to sync the turning on and off of the constant force between players. The owner of the object should control this behavior. For more detailed information, you can refer to 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.ai2mo ago
<@401986039964631060> kapa.ai is still learning and improving, please let us know how it did by reacting below
Mechabit
Mechabit2mo ago
if it's got a realtime transform on it then leave it alone cos you'll be applying changes on top of what it's doing unless the constant acceleration looks funny on remote clients
cryptomax
cryptomax2mo ago
by leave it alone you mean don't bother syncing it turning on or off right as long as it's what it should be while it's owned. cuz yeah I am talking about a rigidbody with a realtime transform on it
Solution
Mechabit
Mechabit2mo ago
no need to sync the extra force then