Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: tim.holman on September 07, 2011, 05:42:44 PM

Title: How to change variables at runtime [SOLVED]
Post by: tim.holman on September 07, 2011, 05:42:44 PM
I've been working on some camera functionality using Playmaker and I would like to know if there's a way to access variables strored in other scripts. For example, I'm using the "Smooth Follow" script and I need to change the target variable at run time (from "Player" to "Golf Ball"). Is there a way to change the target at runtime or do I need to set up another camera?
Title: Re: How to change variables at runtime
Post by: Alex Chouls on September 07, 2011, 05:54:50 PM
You can use the Set Property action in 1.2.

Drag the SmoothFollow component into the object field (you may need to lock the graph view if it's on another gameobject). Then select the property you want to set.

Get and Set Property are very powerful new actions for interacting with any Unity object (e.g., components, textures, materials...)
Title: Re: How to change variables at runtime
Post by: tim.holman on September 08, 2011, 10:42:52 AM
Thanks!