Timeline for How do I find all game objects with particular name?
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 5, 2011 at 13:09 | comment | added | Epic447 | Wha?? Okay, now I am lost :) I have never heard of overloading UI? So I should drop trying to find objects by name (I'm lost!)? I think I recognize 'Enum'. That means I have to type a list of every name of every enemy right? there's around 50! How would I go from there? Please, may I ask you for an example? | |
Aug 5, 2011 at 12:45 | history | edited | Jonathan Connell | CC BY-SA 3.0 |
added 204 characters in body
|
Aug 5, 2011 at 12:39 | comment | added | Jonathan Connell | @Epic447 Ok now I get it :). Indeed you could use a list of string along with a UI overload to make this possible, but it's all rather messy. I'll edit my answer to try and help more. | |
Aug 5, 2011 at 12:14 | comment | added | Epic447 | I appreciate your help so far, and thank you! this will work, but what about when I defeat one the spawners enemies? This code is in the update function- won't the count keep adding 1 each second after it finds someone with the right name? This is really a bigger head scratcher than I thought it would be. Anyway, the gist is to be able to place multiple spawn points in a level, drag and drop people/creatures to spawn at each one, then if the player defeats one of those characters, to spawn another. So all thats needed is a wider method for tallying each thing. I'm just trying not to use tags | |
Aug 5, 2011 at 11:53 | comment | added | Jonathan Connell | @Epic447 I edited the answer to tally the number of objects, but I'm still not sure I understand :). | |
Aug 5, 2011 at 11:47 | history | edited | Jonathan Connell | CC BY-SA 3.0 |
added 15 characters in body
|
Aug 5, 2011 at 11:44 | comment | added | Epic447 | Unless If I can somehow tally 'foreach' to get a count of how many names it finds, I can't use it. I basically need amounts to check if their lengths are below a certain amount, so the spawner can know to instantiate more. I also prefer not to parent the enemies in gameobjects because they have other scripts constantly looking for the root transform, which must be the enemy itself (amongst other reasons). Someone a while ago suggested using 'Get Types' to find String names, but I had no idea how to use it properly with Java script. Any ideas? | |
Aug 5, 2011 at 11:41 | history | edited | Jonathan Connell | CC BY-SA 3.0 |
added 834 characters in body
|
Aug 5, 2011 at 11:35 | history | edited | Jonathan Connell | CC BY-SA 3.0 |
added 834 characters in body
|
Aug 5, 2011 at 11:22 | history | answered | Jonathan Connell | CC BY-SA 3.0 |