Search Unity

problem with follow script

Discussion in 'Scripting' started by 2dfruity, Jan 30, 2015.

  1. 2dfruity

    2dfruity

    Joined:
    May 1, 2014
    Posts:
    75
    my player, who has a Rigidbody2D attached, spawns a minion. this minion also has a Rigidbody2D attached.
    when the minion follows the player on one axis, it bounces up and down/side to side. the transform actually jitters by 0.2 units on the respective axis. both interpolations are set to none.
    the move script is in fixed update and i use transform.Translate to move both of them.
    need to mention that the game's scale is super small, like pixel small, does this matter?
     
  2. Sykoo

    Sykoo

    Joined:
    Jul 25, 2014
    Posts:
    1,394
    It could be better if you use Rigidbody (normal component for 3D) and then ignore the constraints for Z axis in movement and turning for all the axis. If you click on the normal Rigidbody component on your minion, then click on "Constraints" then you can tick the small boxes in order to ignore specified constraints.