# How do I store the highest y position?

How can i do this? i am kinda new on javascript and i have to do some calculations in my game... how can i do this smartly?

if (position.y) - (highestPosition) == +0 position.y = highestPosition

so i want to know if position Y - currenthighest position is bigger than 0 if it is i want highest position to be current y position, i am not sure how to mark y position etc. in unity3d... could any nice and smart humankind help me?

I'm not entirely sure I fully understand the question, but it sounds like you might be looking for this:

``````highestPosition = Mathf.Max(highestPosition, position.y);

``````

It looks like you are looking to record the highest position. You can do those like this:

``````//MAX
if(transform.position.y > highestPosition) highestPosition = transform.position.y;
//or
highestPosition = (transform.position.y > highestPosition)? transform.position.y : highestPosition;
//or
highestPosition = Mathf.Max(highestPosition, transform.position.y);

``````

Thank you very much about this but how can i get my Y position? i mean what is the method? because compiler argues about unknown identifier, what is the identifier for position y, sorry for wasting your time