Vector2 issue with .positon and .position.x accuracy

Hey Guys,

I have this wierd bug where I want to move my characters to a certain position. That position is a Vector2 and is (49.8,-1), I see it in the inspector but when I access the propriety x, the value is 49.75, but in reality it is 49.8 because when I set it in the scene, it should be 49.8, anyone has an idea ?

Thanks a lot.

Claude

Heys Guys, Thanks for the help.

In fact the problem was the following. I was telling my character to move to a position of another character’s position, but it was like a for loop which was calling .MoveToPoint(Vector2) on my character. That function started a coroutine so that was the problem. my movement interval was 0.05 so it seems like there was a slight amount of time where the .x was .75 and the .position wasnt updated yet. So if you encounter the same problem, watch for some coroutines issues.

Thanks a lot guys !

Claude