Answers for "make an enemy go towards player unity"

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 "make an enemy go towards player unity"

C# Answers by Framework

Browse Popular Code Answers by Language