MasterOX 水
MasterOX 水4mo ago

physics objects ownership

physics objects dont move unless they are owned. is there a way to change that?
12 Replies
kapa.ai
kapa.ai4mo ago
Hi @MasterOX 水. 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 for the synchronization of physics objects. The RealtimeTransform component introduces the concept of ownership. When an object is owned by a client, their simulation is considered the source of truth for that object. RealtimeTransform synchronizes the state of the object from the owner to all other clients. If you want to move an object, you need to request ownership of it. This is done by calling RequestOwnership() on the RealtimeTransform component of the object. However, RealtimeTransform works a bit differently when a Rigidbody component is present. 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. This is done to prevent the appearance of delays during those objects’ interactions. If you're trying to directly move an object, make sure to mark it kinematic. Doing so lets PhysX know that you're controlling its position and it should not simulate the object directly. It also tells RealtimeTransform that it should not clear ownership when the object goes to sleep. So, in the current design of NormalVR, physics objects don't move unless they are owned. This is a fundamental part of how physics synchronization is handled in a networked environment to ensure consistency across all clients. Changing this behavior would require significant changes to the underlying networking and physics systems. For more details, you can refer to the following documentation: - RealtimeTransform + Physics (https://normcore.io/documentation/realtime/networked-physics#realtimetransform--physics) - Ownership + Physics (https://normcore.io/documentation/realtime/networked-physics#ownership--physics) - Rigidbody mode (https://normcore.io/documentation/realtime/realtimetransform#rigidbody-mode) - RealtimeTransform (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeTransform) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@758040514678489279> kapa.ai is still learning and improving, please let us know how it did by reacting below
Mechabit
Mechabit4mo ago
sure, use deterministic phsyics and the simulation will be the same for everyone without realtime transforms easier said than done unity dots physics works this way but you'll need to roll back the simulation every time a player moves an object
MasterOX 水
MasterOX 水OP4mo ago
alright, then is there a way to change a synced value thats stored on the object without owning the whole object
Mechabit
Mechabit4mo ago
you don't need ownership to change a model value so long as the view is not owned by someone else
MasterOX 水
MasterOX 水OP4mo ago
yeah but if someone else owns it i cant change it. right?
Mechabit
Mechabit4mo ago
in that case you use a realtime set to send a message to the owner and tell them to change it such as for player health I might do a tutorial some day for these common cases
MasterOX 水
MasterOX 水OP4mo ago
if they own the transform only, will other people be able to change the value?
Mechabit
Mechabit4mo ago
yeah
MasterOX 水
MasterOX 水OP4mo ago
oh alright
Mechabit
Mechabit4mo ago
you don't need view ownership to move an object
MasterOX 水
MasterOX 水OP4mo ago
i wasnt doing that, i just wanted to make sure other people can always change the health value of a physics object ty!