I need to make an "AI" that makes a ball try to touch the player. But Vector2.MoveTowards()
needs a Vector2 variable but how do i get the location of an object?
Take the 2-minute tour
×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
|
||||
|
As Vector2 is a type composed by two numbers which are x and y, then you should be able to get the position by asking both numbers:
So you should use something like:
|
|||||||||||||||||||||
|