Can work check distance with lerp position?
I have script who check distance beetwen platform and player: public Transform other;
public float closeDistance = 5.0F;
void Update()
{
if (other)
{
Vector3 offset = other.position - transform.position;
float sqrLen = offset.sqrMagnitude;
if (sqrLen < closeDistance * closeDistance)
Debug.Log("The other transform is close to me!");
}
}
It works when I have standard player FPS, but when i have player with lerp.position control, this script for check distance dont work. Why?
Comment