How to round position in Unity

Asked

Viewed 46 times

1

My object moves by the keys A,D,W,S. It moves 1 in 1. However, this position is not always round, and can vary from 1.5 to 1.900 and this hinders the collision. Is there a command to round positions?

  • Yes, there is the Mathf.Round. I didn’t answer because I don’t know if this solves your problem, because the question is not totally clear (what is a "position"? is a value of a Vector3 that you use to do the translation? Why does it hinder the collision? The collision is manually made by you, or is Unity doing it? etc).

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.