playMaker

Author Topic: Runtime selection  (Read 1362 times)

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Runtime selection
« on: October 08, 2016, 05:52:51 PM »
Greetings to all.

I have a little problem here.

I have a ui button and 3 game objects and  i want when 1 object is selected in runtime and then the button is clicked the selected object does something , plays its animation for example.

Problem is that those 3 objects are imported from runtime with a unity store asset.

So whatever fsm  must be on the button.

I cant figure out the on object selected part.....

Closest thing is Game object is active on Hierarchy but since 3 objects are imported in runtime it must find automatically which object is active on Hierarchy.

Right now with existing  Game object is active on Hierarchy user must assign the game object.

Can we please make a mod to auto find which object is active on Hierarchy?

Thank you in advance

Michael.

P.S

@jeanfabre
« Last Edit: October 08, 2016, 06:42:01 PM by Michaelb »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7620
    • jinxtergames
Re: Runtime selection
« Reply #1 on: October 09, 2016, 09:40:00 AM »
Hi,
When you create in runtime an object you should store it into a variable or an array.
Then you can use a custom action called 'Is Active' on the Ecosystem

Michaelb

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 53
Re: Runtime selection
« Reply #2 on: October 10, 2016, 06:41:21 PM »
Thank you very much for the reply.

Tried that allready (with variable) , but problem is that i import several items and the importer (asset) is only one , so it gives the same var to all when it imports them.

Will try with array and post back.

Much appreciated for the help.