Hello, I would like create and spawn a GameObject directly from my code to the scene. I read that if I wanted to do that, I should use Instantiate(). My issue with this though is that it’s creating a clone, which I don’t need. I simply want to spawn the original GameObject into the scene.
void createFairy()
{
if (Input.GetKey(KeyCode.F))
{
GameObject objectToCreate = swap.getPlayables();
objectToCreate = Instantiate(new GameObject("Fairy"));
objectToCreate.tag = "Playables";
//Instantiate(objectToCreate);
}
}
This is what I get when I press the F button:
Thanks in advance for the help!