Hey, I’m pretty new to this unity 2d and I just want to ask about some help regarding how to code an ai. as seen on the picture; I want it to follow me. So is there any ways to do a follow script? Please tell me.
//Moving towards player
Vector3 Destination = Player.transform.position;
transform.position += (Destination - transform.position).normalized * Speed;
That’s the general gist of how you move towards the player. If you’re looking for some fancy curving and/or path prediction, look for steering behaviors.