Search Unity

Is it better to use a Character Controller component instead of a Rigidbody for 2D games?

Discussion in 'Physics' started by PhantomFox128, May 30, 2019.

  1. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Hey all. I'm currently trying to prototype a 2D action platformer I'm making and outside of some issues here and there, it's going mostly alright so far. However, I just recently discovered the Character Controller component and was wondering if that would be better for my project. From what I understand, Rigidbody adds some extra physics, like sliding while moving for example, that I don't want and I want the player to have complete control over the characters movement, sort of like in Kirby and the Amazing Mirror or Super Castlevania IV.

    For example, when the move key is pressed, I want the character to start moving at their top speed immediately and then stop dead in their tracks the moment you let go. Would having a Character Controller be better for this?
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Rigidbodies are fully physics driven. Character Controller is basically kinematic rigidbody with collision prevention.

    With CC its up to you to receive callbacks / code your controller behaviour.

    So I'd say yes, it would be better for your case.
     
    PhantomFox128 likes this.