Can't activate child GameObject when game is playing?

I cannot activate a GameObject that is a child of my player. The object is an empty GameObject called “Weapon,” and it itself has a child GameObject which is a sprite. I can activate and de-activate the child GameObject in the Inspector when the game is not playing, but once I hit play the item remains de-activated and I cannot activate it in the Inspector.

I also cannot activate the game object with code. I use the SetActive method, and I even have a print statement after that verifies that the code ran, but the item will still not activate.

I then took away all code associated with that GameObject aside from a [SerializeField] reference to it in a script. Still, will not activate.

I have a gif below showing this behavior. Thanks!

179029-gameobject.gif

Any script can disable a game object, it does not have to be on the object itself. It can even be an animation which disables other objects.

I would guess there is some logic in the parent object (“Player”) which disables your game object (also check if it has any animations running). An easy way to disable a script, without disabling the whole object, is to uncheck the script (prevents the Update() function to be called).