Why won't GUIText render at the same location as a GameObject when passed the same coordinates?


In the spaceship tutorial, the script “Destroy By Contact” has the following code to create an explosion object when an enemy ship is hit.

if (explosion != null)

         Instantiate(explosion, transform.position, transform.rotation);

		*Instantiate(scoreTextPopup, transform.position, transform.rotation);*


I added the second code to create a score popup when the enemy is destroyed. However, the text appears at the bottom left of the screen. Is there a way to convert this coordinate so that the explosion and the GUIText have the same coordinate relative to the Game View?

NOTE: scoreTextPopup is a prefab GUIText with coordinates at 0,0,0. transform.position should be passing the last position of the enemy game object as this script is attached to it.

GUIText position is not in 3D units, check the ObjectLabel example on wiki to see how to make a GUIText following a 3D object