playMaker

Author Topic: Send Object(Transform) var from PM to Behavior Designer  (Read 1576 times)

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Send Object(Transform) var from PM to Behavior Designer
« on: December 12, 2014, 05:52:45 AM »
I'm trying to send a Transform var to Behavior Designer- as we know PM doesn't have a Transform var type so we have to use an Object var using Unity Engine-->Transform

I have scripts that work for all the other var types but I don't know how to work with Object var's- here's the code from the vector3 version

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;

public class BD_to_PM_Variable_v3 : Action
{
public SharedVector3 BDVector3;

public override TaskStatus OnUpdate()
{
var FsmVector3 = FsmVariables.GlobalVariables.FindFsmVector3(BDVector3.Name);
FsmVector3.Value = BDVector3.Value;

return TaskStatus.Success;
}
}

I'm not a coder so I just changed this one that I found to make all the other var types but I can't get it to work for sending a Transform- any help/guidance appreciated- thanks!
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!