Skip to content

Commit

Permalink
Merge pull request #20 from Westerveld/Westerveld-patch
Browse files Browse the repository at this point in the history
Fixed FollowTarget Issue
  • Loading branch information
ciro-unity committed Jun 2, 2018
2 parents db96250 + a4eb46b commit fa456eb
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -21,13 +21,14 @@ public class FollowTarget : Physics2DObject
// FixedUpdate is called once per frame
void FixedUpdate ()
{
//Move towards the target
rigidbody2D.MovePosition(Vector2.Lerp(transform.position, target.position, Time.fixedDeltaTime * speed));

//look towards the target
if(lookAtTarget)
{
Utils.SetAxisTowards(useSide, transform, target.position - transform.position);
}

//Move towards the target
rigidbody2D.MovePosition(Vector2.Lerp(transform.position, target.position, Time.fixedDeltaTime * speed));

}
}

0 comments on commit fa456eb

Please sign in to comment.