Playmaker Forum

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

Title: How do I set an FSM vector3 from script?
Post by: grimmy on April 28, 2014, 09: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, 11: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
Title: Re: How do I set an FSM vector3 from script?
Post by: NewbNinja on May 27, 2022, 04:44:26 PM
This does not answer the question that was asked.

This sets a FLOAT not a VECTOR3.
Title: Re: How do I set an FSM vector3 from script?
Post by: djaydino on May 28, 2022, 10:12:54 AM
Hi.
You can do the same for a vector 3 and other variable types.
It just shows the way you set it up.