Clones will Not remain in scene after Play is stopped.
using UnityEngine;
using System.Collections;
public class Create_Barn : MonoBehaviour
{
public GameObject Equip;
GameObject Equip_Clone;
void Start()
{
Equip_Clone = Instantiate(Equip,transform.position,Quaternion.identity) as GameObject;
}
}
Using the above code, when I try to test if my button works, I press Play, and only ONE (1) clone is created. When I press Play again to stop the test, the Clone Object disappears from the screen and the hierarchy window. Its like the Game Object is never being written to the file. Why does this happen, and how to make it stop? Thanks!
Answer by mfarrell806 · Dec 09, 2016 at 08:21 PM
OK, so I found out this is EXACTLY what is supposed to happen, unless one creates a method to SAVE the game before exiting.
Your answer
Follow this Question
Related Questions
cant get my clone to move, help,,Trying to get my clone to move 0 Answers
How can I change this script so that each instantiated prefab spawns a set amount faster 0 Answers
How to save and load all gamebjects which are cloned at runtime???? 0 Answers
Making clones of a GameObject but then the original gets destroyed 0 Answers
Prefab Enemy2 to track all prefab Enemy1's Instantiates transforms: How? 1 Answer