LookAt() Error

Hi,

I have a strange error, since I dont get what I am doing wrong. I have this code:

public Transform target:

void LateUpdate()
    {
        transform.LookAt(target);
    }

So my object should look at a given target. When I move the gameobject, to which this code is attached I get the following errors:

Assertion failed on expression: ‘IsNormalized(dir)’

Assertion failed on expression: ‘IsNormalized(ray.GetDirection())’

Does anyone know how to fix this? Since I cant move my gameobject and looking at another object at the same time.

Thanks

Sounds like the target is at the exact same position as the object supposed to look at it. Maybe it’s even the very same object.

Thanks for your suggestion, I checked that possibility and I dont think that it occurs in my situation.

I fixed it with, RotateTowards() instead of LookAt(), I dont know why, but the eror didnt occure there