Search code examples
textunity-game-enginetransformmove

Move Ui.Text Unity


I want to move a UI.Text component during runtime via script (in my games circumstance I want to move the player's score to the center of the screen at death).

How can you move UI.Text via script? Is it done through RectTransform?


Solution

  • Yes, it is done through RectTransform obj obj.localPosition = new Vector3(0f,0f,0f);