Hello, im having this problem. Whenever my zombie is folowing me, he starts to follow me and then he suddenly starts to float, the funny thing is that if i delet the animation it will follow me and wont float. It works perfectly, but with animations this happens:
Here is the script:
using UnityEngine;
using System.Collections;
public class GuardLogic : MonoBehaviour {
public bool spotted = false;
public Transform LineEnd;
public Transform LineStart;
public Transform target;
public float speed;
void FixedUpdate ()
{
float step = speed * Time.deltaTime;
transform.position = Vector3.MoveTowards(transform.position, target.position, step);
}
void Update ()
{
Raycasting();
Behaiviours();
}
void Raycasting ()
{
Debug.DrawLine (LineStart.position, LineEnd.position, Color.green);
spotted = Physics2D.Linecast (LineStart.position, LineEnd.position, 1 << LayerMask.NameToLayer (“Player”));
}
void Behaiviours ()
{
}
}
Maybe its somethink with void? Am i using Void start right?