using UnityEngine;
using System.Collections;
public class PreviousPosition : MonoBehaviour {
public Vector3 curpos;
public Vector3 temp = new Vector3(0,0,2f);
public GameObject bomb;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
curpos = transform.position + temp;
Instantiate (bomb, curpos, transform.rotation);
}
}
This was the code.
And this is what happened.
Why are there so many speheres?
I thought this code would spawn one sphere at 2 points further on Z axis. Instead it instantiates tons of spheres at each spheres place.
Thanks.
