playMaker

Author Topic: Select target object using "Move Towards" during runtime.  (Read 1897 times)

Ingot

  • Playmaker Newbie
  • *
  • Posts: 1
Select target object using "Move Towards" during runtime.
« on: January 22, 2015, 04:57:01 PM »
I have a transition state that I need to dynamically set the target object for during
runtime. The target object is the object that the player moves to using "MoveTowards"
after that object is clicked. The object itself can be any one of several buttons on
the GUI that when clicked, sends events to the playmaker FSM and to a script
attached to the player object. The event sent to the FSM changes the state to
"transitioning" and the event sent to the script should set the target object. I
either need to know how to do this entirely using Playmaker, or I need to know
how to drill into the TargetObject inside the MoveTowards action within said script.
I have tried using "gameObject.GetComponent<PlayMakerFSM>()",
but cannot find the TargetObject to set it.

** EDIT **

I found out how to modify the global variables using Playmaker. However, I would
still like to know how to access that variable using code.
« Last Edit: January 22, 2015, 05:56:23 PM by Ingot »

javazgw

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Select target object using "Move Towards" during runtime.
« Reply #1 on: January 30, 2015, 01:26:31 AM »
Did you SOLVED it? I have the same questions.can you help me ?

blackant

  • Hero Member
  • *****
  • Posts: 525
  • http://blackantmaster.com
    • blackantmaster.com
Re: Select target object using "Move Towards" during runtime.
« Reply #2 on: January 30, 2015, 02:01:47 AM »
are your object constrained with your buttons?
if so you can set an array list refering all your objects and when clicked, select the one needed