- Home /
Instantiate doesnt copy components to clone of game object
Hi all, I have made a game object that when the main player collides with it, it uses Instantiate to make a clone of it. But these clones do not have the same attributes as the main game object had on it (Box Collider and a script), or am i writing the code wrong? I wrote the code like this :
Instaniate(gameObject);
Does anyone know why this is happening?
Answer by $$anonymous$$ · Sep 13, 2018 at 06:54 PM
Do you instatiate it from a prefab or from the resources folder or what is "gameObject" in your code?
I instantiated it from the resource folder. In the code it is write i wrote it as a public GameObject
Your answer
Follow this Question
Related Questions
getting .Transform from instanntiated object 2 Answers
How to make an object invisible before it is triggered to show? 2 Answers
problems parenting a gameObject to another upon instantiating when same name exists 1 Answer
Can I use AddComponent to add (this.script) to an object? 1 Answer
Spawn items around GameObject 3 Answers