playMaker

Author Topic: How to activate and deactivate scripts on game objects? [SOLVED]  (Read 3553 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
I have a first person character and a vehicle with a collider.  Both the player and the vehicle have they own unique controller with key mapping in scripts attached to each. Is there a way to turn on and off various scripts upon entering a collider, similar to the check-box next to the script in the Inspector?  So if I enter the vehicle collider it turns off the first person controller, and turns on the vehicle controller.

Thanks!
« Last Edit: January 27, 2014, 01:22:17 PM by adamzeliasz »

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: How to activate and deactivate scripts on game objects?
« Reply #1 on: January 24, 2014, 07:08:03 PM »
trigger event to trigger the action and than use enable fsm action to enable or disable a certain script

greets
peter

Alatriste

  • Full Member
  • ***
  • Posts: 194
Re: How to activate and deactivate scripts on game objects?
« Reply #2 on: January 25, 2014, 04:26:45 AM »
Set Property seems to be able to turn on/off components. You might want to give a try.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to activate and deactivate scripts on game objects?
« Reply #3 on: January 27, 2014, 05:05:42 AM »
Hi,

 there is an action for this as well: "enable Behavior"

bye,

 Jean

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: How to activate and deactivate scripts on game objects?
« Reply #4 on: January 27, 2014, 01:22:02 PM »
Perfect, thats what Im looking for. Thanks!