Deactivating GameObject in Script doesn't Work

Hey there!
I need your Help!
I am making a game and added a new thing to the player. This would make things in the game disappear from their screen but other players can see the objects. The problem is that the object doesn’t disappear. When i try out in build or editor, everything else in the script works except for the line making the thing deactivate.
Any ideas?

GameObject.Find("Scriptedlock").SetActive(false);

Are there any errors in the console? Is “Scriptedlock” spelled correctly? Is it the name of a gameobject, not a script?

No errors, ScriptedLock is spelt correctly, it is a name of a gameobject

Fixed it, the problem was the other parts of the script. They somehow “Blocked the current”

1 Like