Multiple enemy prefabs moving towards a single goal. Need help!

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

		//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! :frowning:

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.


In line 5, remove “bombSpawner.” so each enemy will move from its current position towards the goal, rather than from the spawner’s position towards the goal.