Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Elizeusz on May 24, 2012, 08:10:09 AM

Title: [SOLVED]How to change scripts by playmaker.
Post by: Elizeusz 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 ?  
Title: Re: How to change scripts by playmaker.
Post by: jeanfabre 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 (https://hutonggames.fogbugz.com/default.asp?W688)

Then you can use two actions:

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

and

get property: https://hutonggames.fogbugz.com/default.asp?W695 (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
Title: Re: How to change scripts by playmaker.
Post by: Elizeusz on May 25, 2012, 09:51:55 AM
Perfect ! :) Thank You :)