Structural changes
Structural changes, what you need to consider to avoid shooting yourself in the foot.
Last updated
Was this helpful?
Structural changes, what you need to consider to avoid shooting yourself in the foot.
Last updated
Was this helpful?
When making changes to the structure of an , there are also a few things to consider. In most cases, you can simply edit an entity using Add
and Remove
.
The entity gets a new component and does not have it yet, that fits.
But sometimes you need to take a closer look.
Add and Remove do not check whether the already has these components. In this case, the entity could already have these components and it would lead to a corrupted memory.
It is therefore recommended that you always check beforehand if you cannot guarantee that an entity has or does not have a component.