Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animator component cancels out Rigidbody2D velocity

Discussion in 'Physics' started by templewulf, Oct 13, 2019.

  1. templewulf

    templewulf

    Joined:
    Dec 29, 2013
    Posts:
    52
    Hi all,

    I'm using a script to set the Rigidbody2D.velocity in Start(). I.e. `rb.velocity = new Vector2(3,1);`

    When the animator component is disabled, this works as expected. I can add changes in `Update()`, give it a speed multiplier and get Input.GetAxis(), etc. The Rigidbody2D is set to dynamic.

    However, when I enable the animator component, it doesn't respond to any changes in velocity at all. It only responds to rb.MovePosition() (and only if I change the RB2D type to kinematic).

    What should I be looking for in Animator settings for why it would interfere with my rb.velocity changes?

    Thanks!