Unable to Activate/Deactivate Game Object at Runtime

Hi there!

This just randomly started happening to me today: When I’m in the editor with the game not running, I’m able to activate and deactivate a model using the check box in the inspector. However, when I’m running the game, I’m unable to do this.

I’m using the activate/deactivate option for my gameplay so it’s causing trouble that the object’s activated mode is getting locked while the game runs.

To activate and deactivate these objects, I’m using a PlayMaker action. It’s working on other objects in my game but just not these specific ones. Even so, I’m still unable to manually check the option on and off so I think there is an unexpected setting set on the game objects.

Anyone know why this might be happening?

Thanks in advance!

My guess would be that something in Playmaker or a script is setting that to active every frame.

Hi Jaimi!

I did a bit more nosing around and found that deactivating the animator component on the object allows me control over the active/deactivate checkbox again. I do have events attached to the animations themselves but they all seem to be sending properly and I’m not getting any indication that something is continuously running every frame. When I turn the meshes off before I play the game, they stay locked off so I don’t think they are being forced by the events.

Would you happen to know any feature in the animator that could cause an override to this activate.deactivate toggle?

Okay, I discovered the issue!

I narrowed down a single animator state by deleting chunks of animator states until I could activate/deactivate my objects during runtime. The state causing the trouble contained an animation with an extra property that I must have mistakenly keyed in the editor. I keyed an activation state property at some point which was locking that setting during runtime. This is why my own manual input was being overridden.

Now I can either delete the extra properties from the animation or replace the animation with the original clip from the FBX to correct this user error.