La domanda ha avuto risposta, è stata accettata la risposta giusta
How to make an enemy 2d chasing player?
I 'm doing a 2d platform game , I need to make enemies but do not know how. the enemy shall patrol and chase the player only when the player enters in the trigger of the enemy. i'd need a script because i am noob in c#. Sorry if I have not written correctly but i'm Italian. Thank you in advance. Please, is pretty urgent!
I made a simple enemy chaser like this:
private GameObject Player;
void Start () {
Player = GameObject.Find("Player");
}
void Update () {
transform.position = Vector2.$$anonymous$$oveTowards(transform.position,Player.transform.position, speed*Time.deltaTime);
}
Answer by PictonicStudio · Oct 17, 2015 at 06:58 AM
It sounds like you are struggling with the basics. I would suggest watching this tutorial series. Just posting code would complicate things. It would be beneficial for you to learn! https://www.youtube.com/watch?v=4T7KHysRw84
Follow this Question
Related Questions
How to make an enemy 2d chasing player? 2 Answers
How to have multiple enemies (currently having to kill them in order) 1 Answer
Trouble with directing launched projectiles in Unity 2D 0 Answers
How can make it so only 1 object of type “Ability” can be selected at once? 0 Answers
Boss ai help EoW 0 Answers