#Ghost not serialize with correct components in a build, but normal in the editor

1 messages · Page 1 of 1 (latest)

crude cedar
#

When I try to get a component type by the TypeIndex, I get Unity.NetCode.PendingSpawnPlaceholderComponent, both on the server and on the client. I create a prefab from an entity at runtime by the GhostPrefabCreation.ConvertToGhostPrefab with components already on it, and then spawn ghosts from them.

livid shadow
crude cedar
# livid shadow You'll need to make sure that `ConvertToGhostPrefab()`is getting called on the s...

I think I've solved this issue. The problem is that I store typeindexes in a blob, but they're only stable at runtime. In a build, the typeindex of ghost components are modified by netcode. Or, more precisely, as I understand it, they basically change during build compilation. I'll most likely use stabletypehash, but it also has issues with future version compatibility. Can you tell me how to solve this issue with versioning? The TypeVersion attribute on component struct?