Hi I am having some trouble finding a script that will allow me to have a Gui box that will display the distance between my player and the nearest game object. I am making a large scavenger hunt like game and having only limited scripting knowlege Im not sure how I would do that. All I have so far is
using UnityEngine;
using System.Collections;
public class Findr : MonoBehaviour {
public float distance; //distanceto target
public GameObject Target; //current target
void Update () {
//findtargetwith tag
Target = GameObject.FindGameObjectWithTag(“Paper”);
//finddistanceto target
distance = Vector3.Distance(transform.position, Target.transform.position);
}
}
From this point on im not sure what to do
Many thanks