Closed Logerfo closed 1 year ago
@Logerfo it's better not to use actual Constructor for such things. Just move all logic that uses other entities and EntityManager to OnConstructed
@Logerfo also syncvars isnt readonly. ReadOnly is only SyncableFields, but you can pass anything to them after constructing
Using OnConstructed
worked! You're right about syncvar/syncfield, but using SyncBool I have to wait for the other entity, so I had resize it. Thank you!
ClientEntityManager#Deserialize(byte*, int)
callsConstructAndSync(true)
only after constructing every pending entity, which is a problem when my entity constructor callsGetEntities<T>
looking for a previously constructed entity during the same client tick. Would it be possible to sync every time after constructing each entity? I cannot postpone entity search because it's a dependency for Sync vars, which should be readonly! Am I using a bad practice here? Am I suppose to achieve the behavior I want in a different way?