playMaker

Author Topic: Find game object in array by name?  (Read 2932 times)

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 72
Find game object in array by name?
« on: November 12, 2016, 11:33:42 PM »
Am I missing something seems like there should be a way to do this? I could go long route make a switch that gets index number but seems like a lot of extra work for nothing.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Find game object in array by name?
« Reply #1 on: November 13, 2016, 01:00:45 PM »
Hi,
I checked on the unity forum, you could use hashtable instead.
you can get arraymaker on the Ecosystem
it has hashtables.
or have 2 array one with strings containing the gameobject names and one with the objects.
and do the search in the array with strings to get the index nr

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Find game object in array by name?
« Reply #2 on: November 13, 2016, 01:50:57 PM »
try ArrayListIndexOfByString action from ecosystem

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Find game object in array by name?
« Reply #3 on: November 13, 2016, 03:03:11 PM »
try ArrayListIndexOfByString action from ecosystem
that might work but you need to use the "array maker" package

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 72
Re: Find game object in array by name?
« Reply #4 on: November 13, 2016, 04:58:08 PM »
bummer ill just do a switch sets index number really inefficient way to go about it oh well.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Find game object in array by name?
« Reply #5 on: November 14, 2016, 01:25:57 AM »
Hi,

 Did the suggestions above did not helped you?

Bye,

 Jean