Hi,
I am having issues with comparing positions of objects, with use with Vector3.SmoothDamp:
while (CoverUser.transform.position != desiredPosition)
{
var movementSpeed = new Vector3();
CoverUser.transform.position = Vector3.SmoothDamp(CoverUser.transform.position, desiredPosition, ref movementSpeed, 0.1f);
yield return new WaitForFixedUpdate();
}
The above code means the coroutine is ALWAYS running, because the position of the object is out by ~0.001, and therefore not equal to the desired position.
Is there a way to compare if the position of the object is round-abouts the same as another set position? I don’t want to have to convert everything to Int32’s using Convert.ToInt32() if possible.
Thanks in advance!
Rich