I’m having some problems with having a piece of text popup where I want it to.
I’m using the following code on a monobehavior attached to a game object where I want the text to appear on top of my game object.
How should I arrange it so that my text appears exactly where I want it to here. I have a feeling its a strange mismatch between rect transform position and the game objects transform position.
public void PopupText(string message)
{
var text = GameObject.Instantiate<GameObject> (DamageText);
text.GetComponent<Text>().text = message;
text.transform.position = this._rigidbody.position; //Doesn't Work
text.transform.SetParent (GameObject.Find ("Canvas").transform, false); //Must be on Canvas
}