#Companion Component not compatible with Runtime hybrid component when inspect it.
1 messages · Page 1 of 1 (latest)
are you setting them in baker?
or in runtime?
oh nvm
I read it wrong
Just having component in archetype != it has a non null value
just like normal struct component can be default managed component can be null
runtime, after some test, i found this only happens when i inspect any thing in the subscene. (no matter when)
everything works fine if i select nothing in inspector.
maybe you are adding destroyed game object?
nope, as i said , this only happens when inspect anything, maybe it triggers some baking logic then dirty the result? much like a bug in entites managed store...
this looks like they are just fields in some managed component or am I mistaken?
no, it is monobehavior that added by EntityManager.AddComponentObject
then it means they are null
you need to check for null value, not for component existance
i doubt it is my code issue, because it only happens when using inspector.
and no matter when i use/what i select the inspector, after that, the components become invalid.
but are they truly invalid? can you check in code?
do you mean after ManagedAPI.GetComponent, i still need to check null?
but even with that, how can i ensure i can add&get the component i want?
yeah, just make some log check every frame so you can see if it's actually null after you inspect it
You get component value
it can be null
that's about it
same as entity reference. It can be Entity.Null
i know, but i never remove them, and null-check won't make the code right...
it's not about removing
it's only about setting
because you potentially just set it to null
how's that even happen. the only thing i do is select any gameobject in the Hierachy.