Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Custom Character Controller or Standard Character Controller?

Discussion in 'General Discussion' started by MadJohny, May 31, 2014.

Thread Status:
Not open for further replies.
  1. MadJohny

    MadJohny

    Joined:
    Mar 8, 2013
    Posts:
    143
    Hi, I am currently thinking about starting a fps project that would have parkour included on it (kinda inspired from games like Mirror's Edge and the game that was funded not so much time ago, Hover: Revolt Of Gamers).

    For this type of game, should I use the standard assets character controller or would it be better if I code my own? I feel like coding my own would be better because I would learn from it and actually suit it for my needs but that script seems kinda complicated (looking at the standard fps controller motor), but I also don't like using standard assets, I guess it's something that never appealed to me. So is there any tutorial to get started on that? The one that I've been using was a rigidbody controller and I've latetly started to notice that the movement is actually kinda weird and I feel like character controllers are pretty powerful if I learn how to do them right.
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,716
    CUSTOM

    OH GOD CUSTOM

    Seriously, the included character controller is really only good for prototyping. It's slow, glitchy, generally a mess that deals with its own special physics, and all around a bad thing. For a project like yours, you're really going to need your own.
     
    angrypenguin likes this.
  3. MadJohny

    MadJohny

    Joined:
    Mar 8, 2013
    Posts:
    143
    I was expecting something like that :p I guess I'll start trying something, know of any good resources for starting? I haven't coded a lot of character controller related stuff yet
     
  4. MadJohny

    MadJohny

    Joined:
    Mar 8, 2013
    Posts:
    143
    One question though, don't character controllers always deal with their own physics?
     
  5. sootie8

    sootie8

    Joined:
    Mar 25, 2014
    Posts:
    233
    IsGrounded usually gives odd results for me, make your own if the target hardware can handle it.
     
    VirtualPierogi likes this.
  6. smd863

    smd863

    Joined:
    Jan 26, 2014
    Posts:
    292
    There are two distinct types of character controllers: kinematic and physics-based. Kinematic means you control it manually so the player has perfect control over character motion and you simply fake enough physics so it feels right. Physics-based uses a rigidbody and you apply forces to it, but it is difficult to get it to always give the player precise character control. Kinematic is more common, but if you are doing a heavily physics-based games it can be better to use physics-based characters (i.e. I imagine a game like this uses physics-based character controller: Gang Beasts).

    The standard Unity character controller is kinematic (i.e. it acts as a capsule collider and fakes its own physics). It's a complete black box so you can not modify its behaviour at all without simply rewriting it from scratch (which you will likely end up doing). The character controller that comes with the "Sample Assets" on the Unity asset store is physics-based, and you should be able to customize it.
     
  7. MadJohny

    MadJohny

    Joined:
    Mar 8, 2013
    Posts:
    143
    With character controller I meant an actual Character Controller component.
     
  8. smd863

    smd863

    Joined:
    Jan 26, 2014
    Posts:
    292
    Yes, me, too. That's what I am talking about. There are two basics types: with or without a rigidbody.

    Bottom line is you're usually better off writing your own custom kinematic controller, but that is more challenging than it sounds. You need to manually handle things like collisions, sliding along barriers, stepping over obstacles (i.e. stairs), jumping/falling, etc.
     
  9. Iron-Warrior

    Iron-Warrior

    Joined:
    Nov 3, 2009
    Posts:
    836
    If you're interested in building a custom character controller, I'd recommend checking the link to my blog in my signature. I recently got frustrated with the built in controller, and using Forces to build a responsive character is pretty much impossible so I decided to build my own. Since I pretty much knew nothing about how custom physics work, I decided to write a little series of articles about building one.

    I'm more or less done the first version of the controller and I plan to write a fourth (and final, for awhile) entry detailing how it works, and then I'll find a convenient way to release it to the community.
     
Thread Status:
Not open for further replies.