View difference between Paste ID: wDEfdhnQ and jp3DbFuN
SHOW: | | - or go back to the newest paste.
1
using UnityEngine;
2
using System.Collections;
3
4
public class EnemyHealth : MonoBehaviour 
5
	{
6
	
7
		public Transform target;
8
	
9
		void  OnGUI ()
10
		{ 
11-
			Vector3 wantedPos = Camera.main.WorldToViewportPoint (target.position); 
11+
			Vector3 wantedPos = Camera.main.WorldToScreenPoint (target.position); 
12
			GUI.Label(new Rect(wantedPos.x, wantedPos.y, 100, 20), "Darth Valdemort!");
13
		}
14
	}