Character not moving on Unity 5

I’ve ported a 2d platformer project into Unity 5. After finally getting the project to compile, everything works, except the basic movement for my player, it doesn’t move or jump, though the animations are correctly triggered.

Here is the code for moving and jumping:

public void Move(Direction direction)
    {
        if (CurrentDirection != direction)
        {
            ChangeDirection();
        }

        if (MoveAllowed(direction))
        {
            _rigidbody2D.velocity = new Vector2(Velocity * (int)direction, _rigidbody2D.velocity.y);
            _isRunning = false;
        }
    }

    public void Jump()
    {
        if (CanJump)
        {
            _rigidbody2D.AddForce(new Vector2(0f, JumpForce * _rigidbody2D.mass), ForceMode2D.Impulse);
        }
        else
        {
               OnCollidingOnCeiling(_entityTransform.renderer.bounds.max);
        }
    }

The game runs this code as usual, but it seems that changing the velocity or adding a force no longer works. Why is this happening? Has something drastically change in Unity 5 about 2D rigidbodies?

EDIT: A few things I forgot to mention:

  • The _rigidbody2D is referencing the parents rigidbody2D.
  • _rigidbody2D shows when the program gets to those lines, so it doesn’t look like a problem of missing references.
  • I’m using UnityVS with Visual Studio Community Edition 2013, dunno if it matters.

this happened to my project too. Apparently, the “Apply Root Motion” in the Animation got enabled… Try disabling that again.

You need to GetComponent in unity 5
Explained here: Unity 5: API changes & automatic script updating | Unity Blog