playMaker

Author Topic: [SOLVED]How to change scripts by playmaker.  (Read 5551 times)

Elizeusz

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
[SOLVED]How to change scripts by playmaker.
« on: May 24, 2012, 08:10:09 AM »
Hi. What i need to do if i have script to control my player and after picking some object with trigger i want to change some variables in this script. I want to change speed of my player after picking some objects in my game. What is the best way to do something like this ?  
« Last Edit: May 28, 2012, 01:35:56 PM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15495
  • Official Playmaker Support
    • View Profile
Re: How to change scripts by playmaker.
« Reply #1 on: May 25, 2012, 03:54:43 AM »
Hi,

 Playmaker let you create "Object" variable which can reference any component ( any scripted that you can attached to gameObjects).

more infos here: https://hutonggames.fogbugz.com/default.asp?W688

Then you can use two actions:

set property: https://hutonggames.fogbugz.com/default.asp?W696

and

get property: https://hutonggames.fogbugz.com/default.asp?W695


so you would reference your player component that has this speed value, and you would set that "speed" value using the "set property" action

Bye,

 Jean

Elizeusz

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: How to change scripts by playmaker.
« Reply #2 on: May 25, 2012, 09:51:55 AM »
Perfect ! :) Thank You :)