Hi, Excuse my foolishness. I’m trying to make it so that the player enters a string and if a gameobject by that name exists, we’ll instantiate it. I did the following but of course it doesn’t work. I wasn’t able to find anything related to this (could be my fault) and I’d like to ask you guys for help.
public string name;
public GameObject inputField;
public List<GameObject> objects;
int object_index;
public Transform player;
public void Creator_Input()
{
name = inputField.GetComponent<Text>().text;
Debug.Log(name);
int indexofcreation = objects.IndexOf(name);
Instantiate(objects[0], new Vector3(player.position.x, player.position.y, player.position.z - 2), Quaternion.identity);
}