Answers for "unity enemy move towards player"

C#
1

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);
}
Posted by: Guest on December-17-2020

Code answers related to "unity enemy move towards player"

C# Answers by Framework

Browse Popular Code Answers by Language