I’m currently working on a game that has my player picking up items that then follow the player. So far the following and picking up works, but I can’t seem to make it spawn a new one.
using UnityEngine;
using System.Collections;
public class Pickery : MonoBehaviour {
public static float Counter = 0.0f;
public GameObject parson;
public int Timekeeper = 10;
public GameObject cameran;
void OnTriggerEnter (Collider other){
Counter += 100f;
Debug.Log ("Counter");
cameran.SendMessage("Plus", Timekeeper);
parson.transform.parent = transform;
parson.transform.localPosition = new Vector3(0, 0, -1);
Instantiate(parson, Vector3(Random.Range(10,-35),921,Random.Range(267,310)), Quaternion.identity);
}
}
Any help would be appreciated.