playMaker

Author Topic: [SOLVED] executing a function in another script from Playmaker State node  (Read 3524 times)

amuse

  • Playmaker Newbie
  • *
  • Posts: 5
Hi, I'm new :)

I have a simple mouse click action setup in Playmaker and I want the action to run the function that is in another script like this :

sceneManager.transform.GetComponent("scriptSceneManager").SubtrackLife();

I've tried adding a GetComponent action to the node but that's a dead end.

How can I set this up in my State node?

thanks
« Last Edit: May 20, 2012, 07:00:30 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3999
  • Official Playmaker Support
    • LinkedIn
Re: executing a function in another script from Playmaker State node
« Reply #1 on: April 05, 2012, 07:26:48 PM »
Use a Send Message action.

Also check out the other actions in the Script Control category:
https://hutonggames.fogbugz.com/default.asp?W44

amuse

  • Playmaker Newbie
  • *
  • Posts: 5
Re: executing a function in another script from Playmaker State node
« Reply #2 on: April 05, 2012, 08:05:24 PM »
Things get pretty easy when you know what to connect :)

Got it to work on the first try! Thanks again Alex.

devotid

  • Playmaker Newbie
  • *
  • Posts: 45
i searched all over for this and then found this thread......

Worked for me on the first try too......:)

Now i have a whole new tool in my arsenal.

Thanks again Alex for Playmaker. ;)