Hello, I am making a simple zombie shooter game with Unity! It has been working fine up until the zombie follows the player. It follows fine, but it just walks right through any objects! It has a mesh collider and so does the object it passes through! I am using the SmoothLookAt script and an always move forward script with it to make the zombie move.
The Always Move Forward Script:
function Update () {
transform.Translate(Vector3.forward * Time.deltaTime);
}
Add a character controller. In your script, instead of moving your guy with transform, get the CC component and move it with it.
Use this to move your zombies:
“Attempts to move the controller by motion, the motion will only be constrained by collisions. It will slide along colliders. CollisionFlags is the summary of collisions that occurred during the Move. This function does not apply any gravity.”