hello,
again i have a problem with an AI for a zombie, but i got this errors :
-Assets/scripts/AI_Zombie_Controller.cs(12,20): error CS1502: The best overloaded method match for `UnityEngine.Physics.Raycast(UnityEngine.Vector3, UnityEngine.Vector3, out UnityEngine.RaycastHit, float, int)’ has some invalid arguments
-Assets/scripts/AI_Zombie_Controller.cs(12,20): error CS1620: Argument #3' is missing
out’ modifier
with this script :
using UnityEngine;
using System.Collections;
public class AI_Zombie_Controller : MonoBehaviour {
public float turnspeed = 2;
public float walkspeed = 3;
public float distanceTOwall = 2;
public RaycastHit hit;
void Update () {
if(Physics.Raycast(transform.position, transform.forward, hit, distanceTOwall, 0)){
transform.Rotate(Vector3.up, 90 * turnspeed * Time.deltaTime);
}
else{
transform.Rotate(Vector3.up ,-90 * turnspeed * Time.deltaTime);
}
transform.Translate(Vector3.forward * walkspeed * Time.deltaTime);
}
}
i have found all ready that the problem seems to be in this line of code :
if(Physics.Raycast(transform.position, transform.forward, hit, distanceTOwall, 0)){
could some one explain me how to fix this
thanx