playMaker

Author Topic: Disable a Component  (Read 7492 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Disable a Component
« on: September 12, 2013, 01:58:26 PM »
How can I disable a Component in a GameObject?
For example, I have a script I want to disable when I enter a trigger. And when I exit the trigger, I want to enable the script again. I have tried to look for it, but I can't find anything.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Disable a Component
« Reply #1 on: September 12, 2013, 02:57:30 PM »
I maybe be wrong, but try SetProperty.
I used this to disable a mesh renderer.  I think you can disable any component using that.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Disable a Component
« Reply #2 on: September 12, 2013, 03:16:31 PM »
Thank you! This was very helpful, but I didn't find anything where I can disable the script.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Disable a Component
« Reply #3 on: September 13, 2013, 03:00:07 AM »
Hi,

 the action is called "Enable Behaviour", that's whatz you should use to enabled/disable components and scripts attached to a gameobject.

 Bye,

 Jean