Hide gameobject?


I have an enemy as a gameobject. I want to spawn this enemy at a set location. For this i have a spawningscript

using UnityEngine;
using System.Collections;

public class SwordsmanSpawn1 : MonoBehaviour {
	public GameObject Swordsman;
	public Vector3 spawnSpot;
	void Start() {

		Instantiate(Swordsman, spawnSpot, transform.rotation);

But i dont want the original gameobject of the enemy to be in the scene when i spawn it. When i start, there is 2 “swordsmen” one (the clone) in the desired spawning position and one (the original) in an undesired position. Is it possible to somehow hide the original gameobject so that only the clone will appear in the scene?

Thank you in advance


  • Just drag the prefab into a folder in Unity,
  • Delete the object from the scene (but leave the one inside the folder),
  • Make an empty gameobject in the scene and add your spawnscript to it.
  • Click on the newly created gameobject and drag-and-drop your prefab from your folder into the new gameobject’s script’s Swordman field.

Then you are good to go.