Hi
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.