I’m not sure how to word this question so I will use my code to help. What I am trying to do is get a position of an object and while that object is in that position, I want to turn a boolean to true. However, I also want to translate this object so that it moves but if it moves, the boolean will turn to false since it isnt in the correct position. Can anyone help me with this?
Here is the code:
var topRight : boolean = false;
if((transform.position.x == 7.5) && (transform.position.y == 7.5)){
topRight = true;
transform.Translate(0,1,0);
}