So here is the problem I want the enemy to move towards the player until there is a collision here is the important part of my enemy script:
function Update () {
//rotate to look at the player
myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
//move towards the player
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}
Now everything is setup to detect the collision and react properly but with the code above the enemy and player NEVER collide the enemy gets close to the player and starts to spin around the player without ever colliding…
Is the code above causing the problem?
Any solutions?