playMaker

Author Topic: Passing variables to Script Methods  (Read 12422 times)

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Passing variables to Script Methods
« Reply #15 on: August 19, 2011, 04:20:07 AM »
Well scroll up a few posts and there you go... ;D

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Passing variables to Script Methods
« Reply #16 on: August 19, 2011, 08:36:00 AM »
Hi,
 

 D'oh...

 Of first thing that jump to my eyes: only get the script once during the init of your action, do not do that on each update, that's a killer as well... So store your script reference in a private variable and get it in the OnEnter. GetComponent is also not a very fast method.

 Bye,

 Jean

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Passing variables to Script Methods
« Reply #17 on: August 19, 2011, 10:05:01 AM »
Hmmm good to know! Thanks

Is Get Component any faster then Send Message?

Is there some other conceptual way to do it that would be better to pursue?

My biggest thing with this script was that i had to actually type out the name of the script to cast a variable to do it.. i think that is the correct terminology.. Is there some way that we could use a Fsm Variable for that some how?

Q