Instantiate: How to set the position of prefabs?

I want to instantiate a prefab. I have placed an EmptyObject in my scene. It is named HorseSpawn. I have attached a C# script to it named HorseSpawn. I have a “Horse” prefab in my Resources.

using UnityEngine;
using System.Collections;

public class HorseSpawn : MonoBehaviour {

	// Use this for initialization
	void Start () {
		Instantiate(Resources.Load ("Horse") as GameObject);
	}

	// Update is called once per frame
	void Update () {
	
	}
}

I had assumed that it would inherit the position of the Empty to which the script was attached. It did not. So, what can I do to make it spawn at my EmptyObject?

I am very new to Unity (obviously) and just trying to get my head around the basics. Could you please point me in the right direction? The Unity docs are too complicated to understand. I think they assume we’re all fluent in programming :slight_smile:

The first form of the Instantiate function lets you specify position and rotation.

The instantiate documentation states that you can give the method a second and a third parameter. The second is the position you are looking for (for your case, set it as “transform.position”). The third is the rotation, you can jsut set it as Quaternion.identity.