playMaker

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

grimmy

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


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I set an FSM vector3 from script?
« Reply #1 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
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

NewbNinja

  • Playmaker Newbie
  • *
  • Posts: 15
Re: How do I set an FSM vector3 from script?
« Reply #2 on: May 27, 2022, 04:44:26 PM »
This does not answer the question that was asked.

This sets a FLOAT not a VECTOR3.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7620
    • jinxtergames
Re: How do I set an FSM vector3 from script?
« Reply #3 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.