Spawning Objects at location

Im trying to make my training dummies spawn in front of my player but instead they get spawned off the map how can i change their spawn position? This is a script i took from my lab at my uni.

using UnityEngine;
using System.Collections;

public class TrainingDummySpawn : MonoBehaviour {
public GameObject spawnedObject;

// Use this for initialization

void Start () {
Vector3 position=transform.position;
for(int i=0;i<5;i++){
Instantiate(spawnedObject,position,Quaternion.identity);
position.z+=5.0f;
}
}

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

}

}

Try changing position.z+=5.0f to position.x+=5.0f. or lower the value

Hi, please try below code

using UnityEngine;
using System.Collections;

public class SpawnTest : MonoBehaviour
{
    public GameObject SpawnObject;
    public float ForwardStep = 0.5f;
    // Use this for initialization
    void Start () 
    {
        for (int i = 0; i < 5; ++i)
        {
            GameObject tempGo = GameObject.Instantiate(SpawnObject, Vector3.zero, Quaternion.identity) as GameObject;
            tempGo.transform.parent = transform;
            tempGo.transform.localPosition = transform.forward * ForwardStep * (i + 1);
        }
	}
}

You somehow have to find your player’s position and then use that to spawn your enemies.

There are numerous ways to do this in Unity, read this: http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html