I have a bunch imported FBX objects that are named in sequence. Like this → Object_01,Object_02 - Object_10 and I was wondering if there’s a way I could select them all by name (like in Gameobject.Find) so I can add them sequentially to an array.
That’s more like what I was looking for, but what if you don’t know what the end of a name might be? Is there a way of ignoring it?
In my case the objects are named like this - “Character_G_Hat_01_Straw, Character_G_Hat_02_Cowboy, Character_G_Hat_03_TopHat”
So it works up until the object description i.e. TopHat. I’m currently putting them into arrays manually, which is okay but i was hoping there’d be a nice way to automate it.
Are these objects part of the scene view or are they the .fbx files in the project view? It sounds to me like you want to preload assets and create an array of GameObjects out of them?
Oh sorry, I’m importing a .fbx of each character with all of it’s elements, and then sorting them out within a scene. So I’m going through and manually putting each element into an array, where I feel as though I should be able to sort them based on the naming convention.
Sorry, I guess I’m a little confused as to what you are doing. Are you putting the prefab into the scene and you want to have an array within a MonoBehaviour that has a sorted list of the sub-meshes of the fbx?