Playmaker Forum

Playmaker News => General Discussion => Topic started by: grimmy on April 28, 2014, 06:57:14 AM

Title: How do I set an FSM vector3 from script?
Post by: grimmy on April 28, 2014, 06:57:14 AM
I would have thought it would be:

Code: [Select]
pickUpManagerFSM.FsmVariables.SetFsmVector3("LocationOfPickup").Value = position;
But that don't work.

Any ideas?
Thanks ! :)

Title: Re: How do I set an FSM vector3 from script?
Post by: Lane on April 28, 2014, 08:03:28 AM
Code: [Select]
using UnityEngine;
using System.Collections;
using HutongGames.PlayMaker;

public class NewBehaviourScript : MonoBehaviour {

public PlayMakerFSM TheFSM;
public float myVariable = 52.5f;

void Update () {

FsmFloat test = TheFSM.FsmVariables.GetFsmFloat("test").Value = myVariable;
}
}

This works.

Further info:
https://hutonggames.fogbugz.com/default.asp?W329