playMaker

Author Topic: How do I set an FSM vector3 from script?  (Read 1011 times)

grimmy

  • Junior Playmaker
  • **
  • Posts: 65
    • View Profile
How do I set an FSM vector3 from script?
« 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 ! :)


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: How do I set an FSM vector3 from script?
« Reply #1 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