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;
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);
}
}
}