enemy move towards player unity code example
Example: make an enemy go towards player unity
float speed = whatever;
Vector2 positionToMoveTo = (whatever, whatever);
void Update()
{
transform.position = Vector2.MoveTowards(transform.position, positionToMoveTo, speed * Time.deltaTime);
}