Is it possible to either enable or disable all entities at once?

Hello,

Like the subject,
I would like to know if it’s possible to eitherenable or disable all entities at once.

I know I can enable or disable on the folder level, but somehow it can’t enable an entity if the entity is disabled at its own level.

Hi @sooyong_Kim,

If you mean to set the .enabled property to false for a hierarchy of entities, instead of just disabling the parent the only way is using a loop.

For example here is a one liner using arrow functions (ES6):

entities.forEach( o => o.enabled = false);
1 Like

Is there a way to do it on editor? instead of script?

Just move all entities into a single parent entity. If the parent entity is disabled, so should be the children.

To add on to what @drinkbepis said, if it’s not possible to put them all into a parent entity, you can shift click the top and bottom entities in a list of entities, which will select them all, and then turn off the checkbox in the inspector to disable all selected entities.

You can do it in editor with an editor script, though editor scripting is only unofficially supported so be careful (definitely make a checkpoint before).

Check this thread, it’s old but most of the content is still valid:

You can shift select a group of entities and disable/enable them in one go:

2 Likes