Answer the question
In order to leave comments, you need to log in
How to round transform.position?
I am moving an object to the given coordinates, as soon as it reaches them, the action is triggered
Vector3 TPos;
void BlockSwap(){
if(TPos != obj.transform.position){
Debug.Log(TPos.x +" != " + obj.transform.position.x);
MooveColor.transform.position = Vector3.MoveTowards(obj.transform.position, new Vector3(TPos.x, TPos.y, 0), 5f * Time.deltaTime);
}else{
Action ="";
obj.transform.position = this.transform.position;
}
}
-0.4800001 != -0.4799805
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question