Hi, I have this:
So While the position of an object is not the same the Coroutine can be used, but the object gets on X:14.999 instead of X:15, is there a better way to do it??
IEnumerator Planking(Transform target)
{
while (target.transform.localPosition != targetpos)
{
if (isLookedAt)
{
transform.localPosition = Vector3.SmoothDamp (transform.localPosition, targetpos, ref velocity, smoothTime);
Debug.Log (BridgeIsReadySir);
BridgeIsReadySir = true;
yield return null;
}
yield return null;
}
yield return null;
}