playMaker

Author Topic: Unable to Activate/Deactivate Game Objects [SOLVED]  (Read 792 times)

acornbringer

  • Playmaker Newbie
  • *
  • Posts: 36
    • View Profile
    • Acornbringer.com
Unable to Activate/Deactivate Game Objects [SOLVED]
« on: March 29, 2017, 04:25:22 AM »
Hello!

I'm having this strange issue where I'm able to activate and deactivate a particular game object in the editor by pressing the check box in the inspector when the game is not running but once I'm playing the game, I can no longer do so; it seems locked.

I'm using the Activate Game Object action to switch on and off these meshes during gameplay. It all looks like it's working and I'm not getting any errors so I'm thinking it's something in Unity that is keeping the objects locked in either activated or deactivated mode which is keeping my SFM from doing it's job.

All other similar activate/deactivate actions seem to work. It's only happening with these particular meshes.

This doesn't seem like an issue with PlayMaker it'self but I was hoping someone might have had a similar issue with Unity and knew how to fix.

I would really appreciate any input about this :)

Thanks!
« Last Edit: March 29, 2017, 06:42:33 AM by acornbringer »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13889
  • Official Playmaker Support
    • View Profile
Re: Unable to Activate/Deactivate Game Objects
« Reply #1 on: March 29, 2017, 04:31:14 AM »
Hi,

 likely this is a logical error, Unity doesn't lock anything for GameObjects properties. it's always something the developer has total control over, so it may be that another action is forcing this gameobject to be true and you forgot it or simply did a bad copy paste of action, it happens a lot so triple check your logic.

 Bye,

 Jean

acornbringer

  • Playmaker Newbie
  • *
  • Posts: 36
    • View Profile
    • Acornbringer.com
Re: Unable to Activate/Deactivate Game Objects
« Reply #2 on: March 29, 2017, 05:04:59 AM »
Hi Jean,

The strange thing about this is I haven't changed anything since I last opened the project and before it was working as usual.

I did a little narrowing down and found that turning off the the animator component gives me full control over their activate/deactivate control again.

The only thing I can think that has to do with the animations are the events I added. There are events on the animations that are sent to an SFM to activate and deactivate the models in question.

I looked at the SFMs and they are all activating and deactivating properly so I don't think its a case of an action overruling my input in the inspector for that reason and because when I deactivate them before the game runs, they stay locked as deactivated.

Do you have any suggestions about what the animator could have to do with it? I'm still messing around in there to see as well but I would appreciate another mind on the issue.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13889
  • Official Playmaker Support
    • View Profile
Re: Unable to Activate/Deactivate Game Objects
« Reply #3 on: March 29, 2017, 05:27:41 AM »
Hi,

 very odd indeed, I would ask on Unity forum and UA, I never encountered this nor heard about this. A bit of googling seems to indicate something along that link yes.

 Bye,

 Jean

acornbringer

  • Playmaker Newbie
  • *
  • Posts: 36
    • View Profile
    • Acornbringer.com
Re: Unable to Activate/Deactivate Game Objects
« Reply #4 on: March 29, 2017, 06:41:58 AM »
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 the PlayMaker events and my own manual input were 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.

I'll mark this as solved even though it wasn't really anything to do with PlayMaker. Maybe someone will find it useful!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13889
  • Official Playmaker Support
    • View Profile
Re: Unable to Activate/Deactivate Game Objects [SOLVED]
« Reply #5 on: March 31, 2017, 12:31:20 AM »
Hi,

 Cool, thanks for sharing, it will definitly be useful for people searching for similar issues.

 Bye,

 Jean