Here is my code to move my enemies:
void FixedUpdate(){
Vector3 targ = goal.transform.position;
// Get a direction vector from us to the target
dir = targ - bombSpawner.transform.position;
// Normalize it so that it's a unit direction vector
dir.Normalize();
//move towards dir (goal)
transform.rigidbody2D.AddForce (dir * 2f);
}
They all spawn and move towards the bottom left for some reason. My goal.transform is at 0,0,0 though!
Any ideas or help? Iâm new to C# and unity in general so if I didnât provide enough info, please let me know.
Thanks.