Kevin
Kevin5mo ago

Transform not synced

An object has a realtime transform script and realtime view script. There is also another script that sets the localPosition to a random height and it shows up fine on 1 screen but not the other.
8 Replies
kapa.ai
kapa.ai5mo ago
Hi @Kevin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The issue you're experiencing might be due to the way ownership and synchronization work in Normcore's RealtimeTransform. When you change the localPosition of a GameObject with a RealtimeTransform, the changes are not immediately sent to the server. Instead, Normcore synchronizes at a rate of 20hz and sends the latest state. If you change something and then change it back immediately, nothing will be sent to the server. If you're changing the localPosition in a script, make sure that the script first calls RequestOwnership() on the RealtimeTransform. This will ensure that the client running the script has ownership of the RealtimeTransform and can make changes that will be synchronized to other clients. After making the changes, you should not immediately call ClearOwnership(), as this might prevent the changes from being sent to the server. As long as the RealtimeView’s owner is None, then any other client in the future can just call RequestOwnership() to take over the transform and move it. Also, ensure that the syncPosition property of the RealtimeTransform is set to true. This property controls whether the transform's position is synchronized with the model. Here is the relevant information from the knowledge sources: - RealtimeTransform (https://normcore.io/documentation/reference/classes/Normal.Realtime.RealtimeTransform) - Common Questions (https://normcore.io/documentation/realtime/common-questions#im-calling-requestownership-setting-the-position-of-a-transform-and-then-immediately-calling-clearownershipbut-nothing-happens-how-can-i-fix-this) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@1151175034346414100> kapa.ai is still learning and improving, please let us know how it did by reacting below
Kevin
Kevin5mo ago
@Normcore Assistant I have tried all these things. Also the docs state that if there is no owner anyone can modify it. This is a transform based object and not a rigidbody one. syncPosition is true. And waiting doesnt change anything since if should just update a little later
kapa.ai
kapa.ai5mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If you've tried all the above and the transform is still not syncing, there might be a few other things to consider: 1. Prevent Ownership Takeover: Check if the preventOwnershipTakeover flag is set to true on your model. When this flag is true, the server will deny any client’s attempt to change the ownership of an object in that model unless it has no owner. This could potentially be preventing your changes from being propagated to other clients. Prevent ownership takeover of a RealtimeView (https://normcore.io/documentation/room/ownership-and-lifetime-flags#prevent-ownership-takeover-of-a-realtimeview) 2. RealtimeTransform Ownership: Even though the documentation states that if there is no owner anyone can modify it, it's important to note that for the changes to be propagated to other clients, the client making the changes needs to have ownership. If you're not the owner, the datastore values are treated as the source of truth. Ownership + Physics (https://normcore.io/documentation/realtime/networked-physics#ownership--physics) 3. Network Issues: If everything seems to be set up correctly, it might be worth checking if there are any network issues that could be preventing the changes from being sent or received. If none of these suggestions help, it might be a good idea to reach out to NormalVR's support for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@1151175034346414100> kapa.ai is still learning and improving, please let us know how it did by reacting below
Andrei Vaduva
Andrei Vaduva5mo ago
You need to request ownership of the RealtimeTransform, you can leave the RealtimeView with no owner. I think only RealtimeModels can be modified without ownership
Kevin
Kevin5mo ago
ok so since both clients need to change this at different times I can request ownership and then clear it after the change?
Andrei Vaduva
Andrei Vaduva5mo ago
Yes, you can If you don't spawn with preventOwnershipTakeover you don't even need to clear ownership. You just request ownership when somebody wants to modify the transform