playMaker

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

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Find game object in array by name?
« on: November 12, 2016, 09: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: 4804
    • View Profile
    • jinxtergames
Re: Find game object in array by name?
« Reply #1 on: November 13, 2016, 11:00:45 AM »
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
    • View Profile
Re: Find game object in array by name?
« Reply #2 on: November 13, 2016, 11:50:57 AM »
try ArrayListIndexOfByString action from ecosystem

djaydino

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

Captaincrud

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Re: Find game object in array by name?
« Reply #4 on: November 13, 2016, 02: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: 15060
  • Official Playmaker Support
    • View Profile
Re: Find game object in array by name?
« Reply #5 on: November 13, 2016, 11:25:57 PM »
Hi,

 Did the suggestions above did not helped you?

Bye,

 Jean