GameObject.setActive not triggering within scriptable Objects

Scriptable Objects can only permanently refer to Prefabs on disk.

Prefabs are Instantiated into a scene, making a fresh “live” instance.

Instantiate returns a reference to the instance that it just created.

You must use that Instance reference to do anything, not the reference to the prefab.

Generally you do NOT store instance references in a ScriptableObject because the moment the scene goes away, those references become invalid (null).

For future reference, photographs / screencaps of code are not a thing.

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

1 Like