I have a code that generates a bunch of clones from a prefab and i give them each a unique name depending on which position it’s in. i’m trying to code a behavior script for them. i want them to do something different depending on their name, but i can’t make them aware of their name. I have different parts of their name for different changes to behavior, so it would help if the method could convert to a string to make easier for me to read certain specific characters. i have looked everywhere to try and find a solution, but nothing works. please help.
This maybe?
name returns a string containing the name of the current game object:
void Update () {
Debug.Log(name); //Prints the object name
}