Bug on the position of Score Text

So, I made a mistake and after creating Level 1 and Level 2, the blocks are in different positions on the X,Y,Z grid (The tip of reseting the position of every gameobject is real, people) . So, when the level changes, the Score gets out of the main camera.

How can I reset the position of Score Text ?

I tried adding the line: scoreText.transform.position = new Vector3(435, 477, -8241); on the Aweke, like so:

int gameStatusCount = FindObjectsOfType().Length;
if (gameStatusCount > 1)
{
scoreText.transform.position = new Vector3(435, 477, -8241);
gameObject.SetActive(false);
Destroy(gameObject);
}
else
{
DontDestroyOnLoad(gameObject);
}

How can I change the position on the ScoreText? How can I name a game object from another scene?

Thank you everyone!

Hi Lucas,

Welcome to our community! :slight_smile:

Where is your score text supposed to appear in the game window? Maybe you could fix the anchors in the Rect Transform component.

https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/UIBasicLayout.html


See also:

1 Like

Thank you for the help. I found the problem:

image

My Canvas was “away” of the camera, so the background was covering the score.

Thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms