Hi, I’m trying to make a Super Mario World Boo type enemy, but I am having some difficulties trying to get it working.
From what I’ve seen, a lot of people recommend using a Dot Product, and this is the current version of that script I have.
Vector3 Dis = (player.transform.position - transform.position).normalized;
float d = Vector3.Dot (Dis, transform.position);
Debug.Log(d);
However, the dot product returns with values greater than 1 or lower than -1, which I don’t think is correct. The code above is in the enemy script.
Any help is greatly appreciated!