I'm working on a coop horror game. I attached this script to an enemy, so it will follow the player:
var Player : Transform;
var MoveSpeed = 4;
var MaxDist = 10;
var MinDist = 5;
function Start ()
{
}
function Update ()
{
transform.LookAt(Player);
transform.position += transform.forward*MoveSpeed*Time.deltaTime;
}
Now the problem is: when I start the game and connect to the server, the enemy won't follow the player. Instead the enemy moves to the player's spawn. Does anyone know how to fix this?
(Sorry if my English isn't that good, I'm Dutch)
↧