This is the code I have…
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class minableRocks : MonoBehaviour {
public GameObject Rock;
public GameObject First;
public int minRange;
private Vector3 RockTran;
// Use this for initialization
void OnTriggerEnter(Collider other)
{
}
void Start()
{
Rock = GameObject.FindGameObjectWithTag("HQBigRock");
RockTran = Rock.transform.position;
}
void Update()
{
if (Input.GetMouseButtonDown(0) && (Vector3.Distance(transform.position, Rock.transform.position) <= minRange))
{
Destroy(Rock);
}
else
{
return;
}
}
}
What I want is to be able to create a massive amount of rocks that you have to get a couple of steps away and then left click to mine. However I don’t want to mine all at once and I want to have to click to mine each one individually. Can anyone help with this?