Character Controller Pro

Asset Store
(links in the description)

Contact: lightbug14@gmail.com

■ Description:
Character Controller Pro is a 2D/3D Dynamic Capsule based character controller/system.

  • The character controller allows you to handle the movement, rotation and size of your character (among other things) in a precise way.
  • The character system (also called “implementation”) is built on top of the character controller. It main purpose is to give you some nice and extensible components (character states and abilities, input detection, AI, etc.) allowing you to quickly create your gameplay elements, without reinventing everything from the ground up.

Body
Currently it only supports an upright capsule based character. This basically means that the vertical direction of the capsule will always be transform.up.

Physics
This package works with 2D and 3D physics, so you will get an “all in one” package. This is great if you want to create characters for your 2D and/or 3D projects, using one unified asset (otherwise you will probably have to buy two different assets with no connection between them whatsoever).

Games
This asset can be used with any type of game that requires a 2D/3D capsule based character, from a 2D platformer to a 3D first person shooter.

For more info about this asset please go to the Asset store link or the official asset site.

2 Likes

Looks really good! There used to be a product that I really liked called “Complete Physics Platformer Kit” but it’s been deprecated for a long time now. This looks like it will be a good replacement.

2 Likes

Hey Thanks! I don’t know anything about the Complete Physics Platformer Kit asset, so i can’t confirm you if CCP is similar or not. I saw a bunch of videos, really cool asset!

Hello! Just to announce that an online documentation is available now: → User Manual

I will be improving the whole manual as much as i can, explaining thing better, adding more tutorials, fixing errors, etc. If you feel that something is missing please notify me.

Now the manual is focused in version 1.0.2 (soon). It will serve perfectly for 1.0.1 as well, though.

Over and out!

Hi, version 1.0.2 has just landed on the store :slight_smile:
These are the release notes:

1.0.2

Added

  • Animator: new play “Transition” and “PlayState” modes. Now the states can be use either by playing them directly (Animator.Play) or by using triggers/transitions.
  • CharacterAnimation: the animation component is now using FixedUpdate rather than Update to handle the states.
  • CharacterActor: new “TargetPosition” public property.
  • CharacterActor: new “RigidbodyVelocity” public property.
  • CharacterActor: new “RigidbodyStaticVelocity” public property.
  • Camera3D: position interpolation is now divided into “planar” (the plane formed by the character up direction) and “up”. Both interpolations can be configured separately.
  • CharacterGraphics: rotation offset. This basically will offset the orientation of the graphics object.
  • CharacterGraphics: “Rotation” and “Scale” facing direction modes.
  • Character Actor and Kinematic Actor: Enable/Disable options. Now both, characters and kinematic actors, can be enabled/disabled at any time (using the classic checkbox from the inspector). These actions will freeze/unfreeze the rigidbody.

Changes

  • 3D Scene: it has been modified a little.
  • Demo Character: the default Demo character model has been completely replaced with a humanoid model.
  • Crouch: it is called “Shrink” now, since it’s more appropriate.
  • Arrow modifier: it is called “Gravity modifier”, since it’s more appropriate.
  • CharacterAnimation: now it uses hashes rather than strings.
  • CharacterActor: the character will use the graphics object forward as the desired forward direction, rather than transform.forward (for3D) and transform.right (for 2D).

Fixed

  • CharacterParticles: the CharacterAnimation caused an error when the CharacterParticles component was disabled (due to a missing “PlayFootstep” method).
  • Crouch: the character didn’t change its size when standing on steep slopes.
  • Step handling: now the step up action should be much more smoother than before.
  • Gravity modifiers: incorrect facing direction when the character entered a gravity modifier.

Next release will be a feature update :wink: (1.1.0). For more information about the future of the package please check the roadmap section of the official webpage.

How well does this asset work with things like Mirror networking (basically UNET) or PUN/Bolt Networking?

I’ve been looking for a decent character controller that can easily integrate with basic networking features.

Hello there! CCP hasn’t been tested in any networking environment yet (not quite there). To give you a real answer i will have to test it first, using at least UNET.

To be honest, I don’t think networking will be a reality for CCP until a couple more releases. I would love to include this in the future, though.

Thanks for the interest.

@lightbug14 Really nice controller! I was playing around with demo and it was pretty sweet. Do you have any plans to incorporate vaulting (climbing up and down stuff, over a fence, etc…) and/or climbing ladders at some point or is the controller just going to stick to only basic movement? I didn’t see it on the roadmap.

Thank you @JRRReynolds !

Regarding the ladder climbing system: yes, it will be in the package (1.2 or 1.3). For the first person part (starting from 1.1.0) my goal is to replicate the experience from the amnesia/penumbra games (IMO one of the best first person experience ever), so climbing ladders and head movements (head bob) is definitely in my internal roadmap (i should update the real roadmap).

Regarding the “vaulting”, i have to admit this was never in my internal roadmap. I think you are talking about zelda BOTW style of climbing, if so yeah, it would be a very nice thing to have. Sadly i can’t confirm you 100% since i never did something like this in the past (i will have to investigate first). On the other hand, i implemented ladder climbing systems many times in the past (Penumbra style, Counter strike style, etc), so it shouldn’t be difficult this time.

2 Likes

Hi, version 1.0.4 is available now!

Here are the release notes: Character Controller Pro - Releases

Please note one very important change → Now it’s mandatory to add a scene controller into the scene, otherwise your actors (cameras and characters) will not update at all. But don’t worry, it’s really easy, just drag & drop the “Scene Controller” prefab into the scene.

1 Like

Just a quick note for those of you who are getting these errors in the 3D Scene (Unity 2019):

Search for “Invisible Wall” (there must be 8 of them) and disable the “convex” option from the MeshCollider component.

For whatever reason this is not an error in 2018.4, so yeah.

[EDIT]

This error has been fixed in version 1.0.5, already submitted to the asset store :slight_smile: (pending review).

Can this handle things like wall sliding and wall jumps for 2d platformers, or would I need to add that functionality? And if so, does this handle states like wall contact so those animations and commands can be easily implemented?

Sorry if this is a basic question, I’m a little new at this.

Hello, don’t worry about the question, it’s a very good question. The asset does not include those abilities at the moment, although they can be implemented without problems. In fact i need to “re-implement” wall sliding soon for another asset (Kinematic 2D) which uses this same system now, although not as “complex” as this one, it’s very similar.

The character (CharacterActor component) has some collision flags and events that can be used in a lot of ways. For example if you are implementing a state you can allow the transition to it by code (please see the docs for this, this is explained in detail), for example by reading a flag directly. Some of these flags are related to walls, edges, ground, rigidbodies, etc. For example, the ones related to walls are: WallCollision, WallAngle, WallObject, WallContactPoint, WallContatNormal , IsWallARigidbody, etc. All of these are explained in the API reference included in the asset (Doxygen).

Another way to detect a wall collision is by using a C# event:

public event System.Action<CollisionInfo> OnWallHit;

Animation --------------------------------------------------------------------
One of the big improvements for the next version (1.1.0) is the animation integration with the states. In the current version (1.0.5) the animations work outside the state controller as a separated component, this means that a big animation component is responsible for reading the states, passing parameters to the animator controller, triggering transitions, etc. This scales very poorly as you increse and/or change the number of states. Due to recent events i had to implement a (at least) decent system.

In the next version (two days from now, i hope) the Animatior will be part of the state controller (although you can totally ignore it).

Also the new version supports IK manipulation inside the state (via an event coming from OnAnimatorIK), useful when you want to code the IKs motion for yourself inside your state, whether is by creating the animation, changing weights or simply applying an offset to an existing clip (very useful when the retargeting doesn’t work as expected). And also there will be support for root motion.

For example, this is a ladderClimbing state based purely on Animation (root motion):

And this is from the LedgeHanging state:

Yeah, i’m not an animator as you can probably see :smile: … the tool is there.

These last animation features are not available in 1.0.5 (current version), they will be added in the next version (really soon).

2 Likes

Hey. I got this Character Controller because i had a hard time creating a dynamic one that behaves right but you seem to have it figured out mostly. I did find some issues however.

the first is an actual bug with stair climbing. sometimes it gets stuck in a teleport up/down loop on the stair edge and you phase around for a while till you hit an edge that moves you up or throws you down (happens at around max step height, you can test it on the slopes on the fixed gravity area)

another thing is rigidbody interactions. this one is hard i know but there are some expected interactions that should be improved if possible.
like use the “Columbium” prefab as a catapult by trowing something heavy on the other side. you expect to get launched into the air but you just stick to the object like glue.
i suggest having something like a break force on joints for character position correction forces (same for kinematic platforms because maybe i want it to trow you off)
also standing on rigidbodys is frictionless (i know its needed to not cause other problems but you know what object you stand on, what physics material it has and what velocity it has at contact point. maybe transfer it to the character based of that like custom friction)

also i dont think slopes you cant stand on should reset your jump allowing to spam jump up slopes

these are my first impressions and it works quite well so well done

1 Like

Hello. I just bought this asset and ran into CharacterState class name collision.
I’ve noticed that the asset code is properly wrapped into its own namespace, but that was overlooked in CharacterStateEditor, so it’s trying to reference my CharacterState class instead of yours.
I’ll be grateful if you could add this fix to your next patch.

1 Like

Hi, @HellGate94 thank you very much for the feedback!

Yes, i’m aware of that, in fact i never experienced that, until recently after a customer told me about it. I will work on that.

That’s a great idea, i never thought about that. I think i got something in mind right now, probably it won’t make it to 1.1.0, but i will try to introduce after that.

There are ways you can still modify this using your own states on top, for example you can say if the character isGrounded and the rigidbody vertical velocity is > V then call ForceNotGrounded. This should break the character-ground interaction, making the character to get launched. But don’t believe just yet, i’m gonna test this before (and probably upload the results here).

Yes this applies to what i said before, i need to add this to the RigidbodyComponent. As you probably noticed, there is one of these in everything, that’s necessary to keep the same behaviour for 2D and 3D (also to not write two times the code + avoid bugs all over the place), so every rigidbody related fuctionality need to be wrapped around this concept of Component. In 1.1.0 i included almost every rigidbody property in them, so you can get/set those properties and create your own logic based on that (like in that case you mentioned, getting the friction, point velocity, etc).

For some reason i forgot to include this, i always have a “jumpOnStableGround” or something similar just for this, but it seems i forgot to included to the NormalMovement state. it will be added in 1.1.0.

Hey, Thanks for reporting this! Yes of course it will be fixed. As you can see i tried to carefully wrapped everything around my own namespaces, sorry i missed that one. I will check for others.

1 Like

Hi impressive demo, does this use the usual PhysX CharacterController underneath?

The only issues I saw were it would be nice to have option to slide off the edge of steps/platforms. You can be 99% hanging off a platform but not slide off which looked a bit odd. Also you step up very quickly (instantly?) but that may be a physics limitation.

Hi, thanks, do you mean the kinematic character controller provided by Nvidia (the one Unity implemented called “CharacterController”) ? If that’s what you mean the answer is no, the character consist of a collider + rigidbody (dynamic, not kinematic) + CCP components: main character component, a “brain”, a state controller (FSM) with all the individual states associated to this.

Regarding the edges, the character always follow the “stable normal”, not the “contact normal”, see the next image (from the docs):

Some people love that, some people hate it, it’s not “realistic” of course (but games are not supposed to be 100% realistic). There are ways to make this pretty, for example by changing the width (2*radius). Another way is to include an option to follow a specific normal vector, for example if you don’t like how it looks using the “stable normal” maybe you can try with the “contact normal”.
I will consider that case for future versions, thanks for the suggestion.

As i probably mentioned before, this step up mechanic is one of the most tricky ones (not necessarely complex). It works very similar to the one implemented in the physx controller (at least i tried to imitate that one), you can climb up steps of (for example) 1000 * times de height of your character. Moreover, it will check if the character fits in the final position. Wow, isn’t that impressive? yeah, but not too realistic (if realism is what you want). So, as always there is a trade-off with every decision made.

IMO a “step up” should be used to avoid irregularities in the ground + climb small believable steps (<= capsule radius), without entering in another state, or at least without you noticing that. Stairs works fine, but that should be the extreme case (even the stairs in the demo are too unrealistic).

A more realistic step up would be this one (6:30):

https://www.youtube.com/watch?v=PryJ3CpHcXQ

but that’s too specific and heavy for a multi purpose character controller.

1 Like

Thanks ok that is a more complex and impressive way for physics interaction at least!
Yes I think option for using contact normal would be good

Hello, recently purchased this asset and am really impressed!

I am trying to use this as a First Person Controller for VR, and am having some challenges adapting this asset.

In particular, I would like:
1) Movement input to take the camera rotation(yaw) into consideration (i.e. If moving forward and looking left, character should move forward AND left diagonally) .
2) Movement input relevant to camera forward (seems I can only affect rotation with “CharacterGraphics”, otherwise player moves in world directions?
3) Rotation independent from movement *(*with “CharacterGraphics” enabled, movement input influences rotation which causes you to spin quickly, not good in VR. I have been trying to implement snap turning, but it is not playing nice with “CharacterGraphics” )

I have read the documentation and don’t see any obvious inspector settings to achieve the desired results. Would you have any recommendations on how to configure?