This question was
closed Dec 16, 2016 at 04:58 PM by
dandelo99.
Question by
dandelo99 · Nov 07, 2016 at 02:16 PM ·
unity 2dstorehighscoresy-axis
How to store max y position of object
i have a script for showing height of my rocket but i want to store max height of my rocket to HighScoreText which it reached. this is part of my script ; (sorry for my english thanks for help)
public class PowerOn : MonoBehaviour {
public Text AltitudeText;
public Text HighScoreText;
void Update()
{
float alt = transform.position.y * 10;
AltitudeText.text = "Your Height :" + alt.ToString("#.00") + "m";
if (alt < 1)
{
AltitudeText.text = "Your Height : 0.00 m";
}
}
i want to something like your reached max height : 300.00 m this round for example
Comment
Follow this Question
Related Questions
publishing unity game to playstore,launching unity app to playstore ! 1 Answer
When obstacles collide with tag move to y axis which is randomly chosen out of 3 values 0 Answers
How to make a high score C# script with scenes ? 0 Answers
Unrecognized assets cannot be included in AssetBundle: "....dll". 4 Answers