xulipa
xulipa5mo ago

Realtime: RealtimeViewModel was deleted from datastore, but has no corresponding prefab

Can you go into details of what this error means and what possibly could be wrong: Realtime: RealtimeViewModel was deleted from datastore, but has no corresponding prefab. This is a bug. UnityEngine.Debug:LogError (object) Normal.Realtime.Realtime:PrefabRealtimeViewModelRemoved (Normal.Realtime.Datastore,Normal.Realtime.RealtimeViewModel,bool) Normal.Realtime.Datastore:PrefabViewModelRemovedFromSet (Normal.Realtime.Serialization.RealtimeSet1<Normal.Realtime.RealtimeViewModel>,Normal.Realtime.RealtimeViewModel,bool) Normal.Realtime.Serialization.RealtimeSet1<Normal.Realtime.RealtimeViewModel>:SafeDispatchModelRemoved (Normal.Realtime.RealtimeViewModel,bool) Normal.Realtime.Serialization.RealtimeSet`1<Normal.Realtime.RealtimeViewModel>:Read (Normal.Realtime.Serialization.ReadStream,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.RealtimeModel:Normal.Realtime.Serialization.IStreamReader.Read (Normal.Realtime.Serialization.ReadStream,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.Serialization.ReadStream:ReadRawModel (Normal.Realtime.Serialization.IStreamReader,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.Serialization.ReadStream:ReadCollection (Normal.Realtime.Serialization.IStreamReader,Normal.Realtime.Serialization.StreamContext,bool) Normal.Realtime.Datastore:Read (Normal.Realtime.Serialization.ReadStream,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.Serialization.ReadStream:ReadRawModel (Normal.Realtime.Serialization.IStreamReader,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.Serialization.ReadStream:DeserializeModel (Normal.Realtime.Serialization.IStreamReader,Normal.Realtime.Serialization.StreamContext) Normal.Realtime.Datastore:DeserializeDeltaUpdates (byte[],bool,bool,double) Normal.Realtime.Room:ReceivedPersistenceMessage (Normal.Realtime.Native.IClient,int,byte[],uint,bool) Normal.Realtime.Native.Client:ReceivePersistenceMessages ()
2 Replies
kapa.ai
kapa.ai5mo ago
Hi @xulipa. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message "Realtime: RealtimeViewModel was deleted from datastore, but has no corresponding prefab. This is a bug." suggests that a RealtimeViewModel was removed from the datastore, but there was no corresponding prefab for it in the scene. This could be due to a variety of reasons, such as a bug in the code or an issue with the synchronization of the prefab across multiple clients. In Normcore, a RealtimeView is used to identify a game object and its RealtimeComponents across multiple clients. When a prefab is instantiated, RealtimeView creates a model for each RealtimeComponent on the prefab and puts it into the datastore. Then, when the prefab is instantiated on other clients, RealtimeView will connect the model in the datastore with its respective RealtimeComponent on the prefab (source (https://normcore.io/documentation/realtime/realtimeview)). If a RealtimeViewModel is being deleted from the datastore without a corresponding prefab, it could mean that the prefab was not properly instantiated on all clients, or that it was destroyed on one client but not on others. One common issue that can cause this error is when multiple clients attempt to delete the same model from a RealtimeSet at the same time. This can happen if multiple clients call Realtime.Destroy() on the same object at the same time. To prevent this, it is generally recommended to have the client that owns the object destroy it: if (realtimeView.isOwnedLocally) Realtime.Destroy(gameObject); (source (https://normcore.io/documentation/room/common-questions#im-getting-the-error-server-attempted-to-delete-value-from-set-for-key-that-doesnt-exist-in-storage-this-is-a-bug-how-do-i-fix-this)). If you're still encountering this issue, it might be helpful to review your code to ensure that prefabs are being properly instantiated and destroyed across all clients. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5mo ago
<@725231244169707600> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?