mhjort
mhjort
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
BTW, are there any plans on supporting adding RealtimeTransform components in runtime? Our game platform is very dynamic and we need to run the same code both in single player and multiplayer context. For us it is a bit cumbersome to add Realtime components before hand. One feature we have is that we generate 3D objects in the fly using AI and import them as game objects in runtime. This already works in single player context but I have no idea how to make that work in Normcore...
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
Also I learned a bit what was missing by opening prefabs with text editor. So I think I now understand roughly the metadata that is required for this to work.
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
@Max I think I found the issue. We have almost one hundred vehicle objects objects that need RealtIme components. To avoid manual work I added Editor script that adds the components. However, Normcore does some magic (adds metadata) after those components are added in the editor. Apparently my editor script was not saving the prefabs correctly. And then when ever I opened those assets in editor to see if the asset is ok the magic processing fixed the asset. So every time I inspected assets and then restarted the game it worked. For this reason it felt that sometimes things worked and sometimes not 😅
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
From inspector I can see that in this failure case RealtimeView owner is Local Client but Realtime Transform owner is offline.
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
I'll check that
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
In this case the objects that I spawn are vehicles and they are quite complex (they contain lots of components)
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
Hmm.. I tested with some delay between spawns (they are not spawned in same frame anymore) and haven't seen any errors since then. Need to test more still.
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
I am already passing the owned by client flag. This way RealtimeView is owned by the client but not the RealtimeTransform. I am trying to call RequestOwnership for the RealtimeTransform but that fails sometimes.
24 replies
NNormal
Created by mhjort on 4/9/2024 in #🤝ask-a-question
Why the Realtime instantiated object is not always ready
I have no custom components. If I understand the documentation correctly OnRealtimeModelReplaced is relevant only with custom models.
24 replies