Hi,
I currently have two classes : Character and zombie.
I would like to give to my zombie my character position.
This is my character class :
public class Character : MonoBehaviour{
public Transform GetMyPosition(){
return this.transform;
}
}
And there is my zombie class :
public class zombie : MonoBehaviour {
public Transform origin;
public Character character;
void Update () {
deplace ();
}
void deplace(){
//Vector3 destination = cible.position;
Vector3 alienPos = origin.position;
origin.LookAt (character.GetMyPosition());
}
}
Problem is that actually, zombies are looking at 0.0.0 : my original position, and they keep looking at 0.0.0 when i am mooving.
This is how i linked ressources :
Thank you for your help !