Answers for "truePos.x = Mathf.Floor(target2.transform.position.x / gridSize) * gridSize; truePos.y = Mathf.Floor(target2.transform.position.y / gridSize) * gridSize; truePos.z = Mathf.Floor(target2.transform.position.z / gridSize) * gridSize;"

C#
1

unity round vector 3 to nearest integer

//Converts a Vector3 to a Vector3Int by doing a Round to each value.
Vector3Int.RoundToInt(Vector3)
Posted by: Guest on March-26-2020
-1

round vector3 unity

vector3 = new Vector3(1.23243f, 2.213124f, 12.4123f);
 var roundedVector3 = vector3.Round(1);
Posted by: Guest on April-05-2020

C# Answers by Framework

Browse Popular Code Answers by Language