Recommendations on Character Controllers?

I’d like input from folks who have more experience on what is the best way to go about a character controller, as well as how to go about implementing certain necessary features.

First off, generally speaking, what is the best way to do a character controller? I know that there is a tutorial for making one here that works based on Unity’s physics, and there is another character controller here that does most everything manually rather than using Unity’s physics. I like the idea of using Unity’s physics (so it can play well with, say, PointEffectors, which I will be using in my project), but I’d also like to have the controls feel tight and good, rather than floaty in that sloppy something-feels-amateurish-about-this way. What are peoples’ recommendations? Links to implementation examples would be appreciated as well, if you know of any.

Second off, I’m currently working with an implementation of the 2D Character Controller as described in the first link’s tutorial (more or less), but it has an issue where, if the player character is moving into a wall, the friction from the wall (I assume) prevents the player from falling until the player stops moving against the wall. Is that a bug in the controller or just a quirk of the physics that needs to be dealt with(and if so, how)?

Finally, I’d like to implement varied jump heights based on how long the player holds down the jump button, ideally with there being a short, medium, and long jump from the button being quick tapped, pressed, or held, respectively. I’m not sure how I’d implement such a thing using physics-based systems while keeping everything feeling tight. Any suggestions there?

Essentially, it’d be nice if I could have controls as tight as, say, Super Meat Boy’s, and while I know that the sky’s the limit and I’m sure I could bang out something that sort of did the trick eventually, I’d like to know what ways work best and what people with experience would recommend before I dive headlong and make an over-complicated mess of things. :slight_smile:

I’d really appreciate your help.

Check out this 2D platforming character controller:

http://battlebrothers.io/acrocatic/

Acrocatic uses the built-in physics in Unity. It’s also free because the guy stopped working on it – but he posted a hint recently that he may start updating it again. In any case, it’s useful right now and may solve your problem. That page linked above has several demo videos showing what it can do.

Jay

2 Likes

Thanks for the link! But I’d also like to know how to MAKE such things. I mean, naturally I can download the asset, look at the code, and pick and choose what I like, but I’d also like to hear if that asset represents the standard way of making the sort of controller I’m looking for, or if there is a better path. I’d like to grow as a programmer as much as just as a game developer, so I’d love to hear more input on what way is best. :slight_smile:

There is a youtube video I watched recently that was explaining how to make your own character controller by code in C# it is in 3D though. Below is the link if you want to check it out. He makes a script separately for the character and for the camera. The video in total takes around 20 minutes.

1 Like

Essentially, your game mechanics will drive how you want to build your character controller. Jeffthegreat17 linked an excellent video. If you’re new to the concept of 2d game physics I would recommend giving this a run through: http://www.rodedev.com/tutorials/gamephysics/

Also, raycasts are your best friends for collision detection. I would highly recommend getting familiar with them.

2 Likes