How to Activate / Deactivate Component of Entity with nodes

As the doc says " Lumberyard’s components have a simple lifecycle. When an entity is activated, it calls Activate() on all of its components. When the entity is deactivated, it calls Deactivate() on all of its components."
and "Note that a component can be activated and deactivated many times before it is deleted. "

But I can’t find a Deactivate/Activate Component Node script ? only a Destroy Component as below … :face_with_monocle:

Is the solution that consists to add a child entity with the component and then Activate/Deactivate this child Entity the only way/good way to do it ?

1 Like

@Didier I agree with you completely :100:% ,

@LS1 Is it possible , we can see this feature in LY 1.25.1 or 1.26 :question:?

This topics is very important :white_check_mark:

We need to Active Component/Deactive Component/Destroy Component/Create component in Entity (During the game run / simulation run / 3D visualization run) :slightly_smiling_face:

1 Like

Hi Didier,

I think the part in the docs about a component being potentially activated and deactivated many times during its lifetime refers to the fact that an entity can be repeatedly activated/deactivated (which will activate/deactivate all the individual components on the entity), so when writing the activation code for a component you should be careful to make sure that it can be reactivated safely.

It is a bit awkward to deactivate individual components, because other components may depend on them, and they would have to be deactivated as well. This could lead to a whole chain of deactivations which might have unintended consequences. It is also not a totally trivial operation to evaluate the dependency graph and deactivate the necessary components to return the entity to a valid state. For this reason, the system is not really designed to modify the components of an activated entity at runtime. Even the destroy component node which you mentioned will only work on a deactivated entity.

The suggestion you made of putting the component you want to deactivate on a child entity sounds like it could be a reasonable approach. Could you give a little more detail about your particular use case?

Best wishes,


Hi @dgreer, it’s simply when using a large number of entities and where it’s interesting to get a component that can be activated and deactivated many times for keeping performances … and for me it’s mandatory too as it’s already well specified in the documentation as available :slight_smile:

This process is available in other engines, I Strongly need to add, remove, activate and deactivate the components, especially in a script canvas open world game.