playMaker

Author Topic: Why there is no Type "Transform" in State Machine Variables ?  (Read 388 times)

yuewah

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Why there is no Type "Transform" in State Machine Variables ?
« on: August 01, 2012, 07:29:50 AM »
Why there is no Type "Transform" in State Machine Variables ?

Red

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #1 on: August 01, 2012, 12:43:24 PM »
not sure i fully understand what you're aiming for... do you mean the vector3 variable (which will store x, y and z coordinates) which can be used to transform an object's position or more a thing to handle rotation (using a vector3 variable for the rotational offsets?)

or both?

yuewah

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #2 on: August 01, 2012, 07:25:46 PM »
No, the unity class called Transform that contains both position, rotation and scale.

PIXELCRY

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #3 on: January 02, 2013, 08:34:51 AM »
Hi sorry for upping this topic, i actually have same problem:

my script have this variable "   public Transform target;" from the inspector i can assign directly a gameobject
but when i try to use action "set property" on "target" i cant find a matching variable that can be used :(

kiriri

  • Sr. Member
  • ****
  • Posts: 436
    • View Profile
    • Email
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #4 on: January 02, 2013, 09:35:07 AM »
when scripting you're always using the namespace UnityEngine. Go figure in which category the Transform is :P
(Tipp: in the object type selection first go to unityEngine and then select Transform from the long list that should appear.)
Best,
Sven

jeanfabre

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 3386
    • View Profile
    • Email
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #5 on: January 02, 2013, 12:46:13 PM »
Hi,

 Yes FsmTransform is very much missing for me too, as well as FsmEnum to reference existing enums from various scripts and apis...

and FsmAudio while I am at it :)

bye,

 Jean

PIXELCRY

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #6 on: January 03, 2013, 07:23:18 AM »
when scripting you're always using the namespace UnityEngine. Go figure in which category the Transform is :P
(Tipp: in the object type selection first go to unityEngine and then select Transform from the long list that should appear.)

I dont get your meaning, im using a NGUI script and i tried to change the variable from transform to gameobject, but i cant get it work.

kiriri

  • Sr. Member
  • ****
  • Posts: 436
    • View Profile
    • Email
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #7 on: January 03, 2013, 07:35:11 AM »
I explained it on the mesh variable here:
http://hutonggames.com/playmakerforum/index.php?topic=2396.0

or alternatively I've got a one minute silent tut here :
http://youtu.be/dHiNr4qjHHs

It's the same principle for the transform. You can either use GetComponent and use an object variable of the type UnityEngine/Transform or you can use get Property on the gameObject with the transforms you want and save it to said UnityEngine/Transform variable.

This object variable will then be useable for the set Property action.
« Last Edit: January 03, 2013, 07:52:07 AM by kiriri »
Best,
Sven

PIXELCRY

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Why there is no Type "Transform" in State Machine Variables ?
« Reply #8 on: January 03, 2013, 08:26:34 AM »
oh awesome i didnt know it was possible! thank you

anyway i found an other way just create a new public game object variable and put it value in my transform variable

target = targetGO.transform;