I'm making a tile based movement game and I'm using Vector3.MoveTowards() to move the player. When I play my game, whenever the player's x or z position are supposed to be 0, they become random numbers in the inspector that are way off with lots of digits after the decimal. My script for the player isn't acting how it's supposed to be when it hits walls when their position is supposed 0 for x or z.
My script detects collision by looping through all the obstacles and checking if the position of the obstacle is the same as what position the player's going to go to.
Is this a glitch? Is there any way to fix this?
↧