# Why are my target-following objects rotated the wrong way?

I writing a script that would make my players reach a target destination. It looks like this so far:

private void MoveTowardsGoal() {
if (Vector3.Distance (reachGoalTarget.transform.position, transform.position) > 2.0f) {
rDirection = (reachGoalTarget.transform.position - transform.position).normalized;
if (rAcceleration < rMaxSpeed) {
rAcceleration += 0.5f;
}
rVelocity = rDirection * Time.deltaTime * rAcceleration;
transform.Translate (rVelocity,Space.World);
}
}


It works fine: The objects move towards the destination point. However, I want them to move looking at the target in the forward direction (forward z axis). Currently they move with their x axis facing front.

I tried a simple rotation inside Start() like transform.LookAt(reachGoalTarget.transform). With this, they look in the forward direction but then they completely move off their initial positions by rotating themselves to reach the goal.

What am I doing wrong?

• What does this mean? "they completely move off their initial positions by rotating themselves to reach the goal". You mean the objects are not rotating around the correct center? Have you tried putting the LookAt code in the update method instead of the start method? – MichaelHouse Sep 10 '14 at 5:25
• Given the solution he found (his deleted answer says "I increased the target size and it worked") I'm voting to close this question. There is no useful information here. – jhocking Mar 11 '15 at 13:02