vector3 distance same script different objects
hi i want to know the distance between the Gameobject that have the script and player. but the distance is adding up between carriers of the same script so....what can i do ?
if (Vector3.Distance(gameObject.transform.position,
> player.transform.position) < 2f)
> {
> npcNameText.text = gameObject.name;
> narracionQuest.text = questText;
> }
> else
> {
> npcNameText.text = "";
> narracionQuest.text = "";
>
> }
Comment