Search Unity

  1. Unity 2019.4 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  3. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

▓▓▓▓▓▒▒▒▒▒░░░░░ Character Controller Pro (1.0.5) ░░░░░▒▒▒▒▒▓▓▓▓▓

Discussion in 'Assets and Asset Store' started by lightbug14, Jan 15, 2020.

  1. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hello everyone, I'm super happy to present you Character Controller Pro.



    Asset Store
    Official asset site
    Demo (Desktop)
    User Manual (online)


    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.


    ────────────────────────────────────────────────────────
    3D Scene


    2D Scene


    Mobile Scene
     
    Last edited: Jan 24, 2020
    Peter77 likes this.
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    2,373
    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.
     
    EstudioVR and lightbug14 like this.
  3. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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!
     
  4. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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!
     
  5. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi, version 1.0.2 has just landed on the store :)
    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 ;) (1.1.0). For more information about the future of the package please check the roadmap section of the official webpage.
     
  6. PyroStudios

    PyroStudios

    Joined:
    Sep 23, 2012
    Posts:
    225
    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.
     
  7. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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.
     
  8. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    171
    @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.
     
  9. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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.
     
    ikemen_blueD and JRRReynolds like this.
  10. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi, version 1.0.4 is available now!

    Here are the release notes: https://lightbug14.github.io/CharacterControllerPro/releases.html

    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.
     
    IO-Fox likes this.
  11. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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 :) (pending review).
     
    Last edited: Mar 16, 2020
  12. midnightcampaign

    midnightcampaign

    Joined:
    Apr 14, 2020
    Posts:
    1
    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.
     
  13. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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:
    Code (CSharp):
    1. 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 :D ... 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).
     
    ikemen_blueD and IO-Fox like this.
  14. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    13
    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
     
    Last edited: Apr 16, 2020
    lightbug14 likes this.
  15. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    217
    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.
     
    Last edited: Apr 16, 2020
    lightbug14 likes this.
  16. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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.
     
    HellGate94 likes this.
  17. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,287
    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.
     
  18. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    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):


    but that's too specific and heavy for a multi purpose character controller.
     
    andyz likes this.
  19. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    1,287
    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
     
  20. hessex

    hessex

    Joined:
    Jul 24, 2019
    Posts:
    7
    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?
     
  21. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hello, thanks for buying!

    First, i don't know anything about VR, whether is the movement, the controls, the tools, etc. Of course i don't have a VR headset here with me, so forgive me if i can't answer to your questions in more detail.
    Let's start with something very basic: headset looking direction == camera.forward, right? I assume you're using like a "VR Camera" component or something.

    1) The character should follow the camera forward only if the external "movement reference mode" is selected. The problem (with VR) is that the movement will not be diagonal, it will always follow the forward direction.

    2) You are correct, the reason why the character is using world coordinates is because of 2D. If the character rotates around the up ("yaw") the collider will do that as well (which causes problems with the 2D physics). So there is a conflict between 2D and 3D movement, which is one of the key points in this asset. That's why there is a "foward direction", independent from the character rotation. I know it's a hack, but it works in every single situation (2D and 3D).
    This forward direction vector (CharacterActor) can be modified anytime.

    3) Ok, i will check that.

    I've received like two or three requests about VR. At the moment VR is out of scope for this asset (at least i have more relevant things to improve: animation, inputs, basic networking, ...). That said, if you are interested in using VR with this asset and want to help make this possible, please send me an email with all the key aspects you need (even if they are the ones you mentioned here). That way i can follow that like a guide to achieve a VR compatible character. Of course i will investigate about it, eventually.


    Regards.
     
  22. hessex

    hessex

    Joined:
    Jul 24, 2019
    Posts:
    7
    Thank you for the quick response, I've had some success on my second attempt based on your external movement reference suggestion. Here's what I've found so far:

    Initial Prefab set-up:

    Character Controller (configured "movement reference mode" to "character")
    |_Graphics (missing in next set-up)
    |_Character Rig
    |_Character-Mesh
    |_Character-Skeletal-Rig​
    |_XR-Rig
    |_Main Camera
    |_Left Hand
    |_Right Hand​

    Functional VR Prefab set-up (removed "Graphics" game object and components):

    Character Controller (configured external "movement reference mode" to "Main Camera")
    |_Character Rig
    |_Character-Mesh
    |_Character-Skeletal-Rig​
    |_XR-Rig
    |_Main Camera(<--- used for movement reference)
    |_Left Hand
    |_Right Hand​


    In both cases the XR-Rig (camera and hand transforms), are parented by the controller to keep position and rotation alignment. I am using Unity's XR integration in 2019.3. In the initial set-up of CCP, joystick input would rotate you in alignment with the joystick, causing you to run in tight circles (quite dizzying in VR o_O), or simply flip your orientation in world space if you pressed the extremes of each axis (immediately align you N, E, S, W so to speak ...).

    In the second set up, I am able to control planar movement with directional movement from input multiplied by the camera direction. If running forward in a scene, and looking left, my character's movement eases in the direction I am looking. If backing away, and looking left, my character backs to the right (opposite of the direction I am looking). This is great!


    Regarding your comments:
    1) That worked! I may have been overthinking "external" to mean "not a child of controller"
    2) Thanks for the explanation, VR users may need to understand referencing an "external" forward (i.e. Tracking Space for Oculus), and using a non "Graphics" prefab.
    3) Sure, I'll send a private email.​

    Again, thank you for the wonderful product, I am excited to fully integrate it into my project.
     
    Last edited: Apr 20, 2020
    lightbug14 likes this.
  23. Crouching-Tuna

    Crouching-Tuna

    Joined:
    Apr 4, 2014
    Posts:
    47
    Halo, i bought ur K2D and liked the engine part, and now gonna work on a topdown kinda jump-y next and considering getting this one

    So, i wonder what's gonna be the biggest hurdle for networked, for dynamic physics CC type, and if this asset have a chance to address them.
    Of course, it depends on the game itself. But i wonder what you think about my following abstract considerations..

    1. Allow pushing? I'm willing to drop this and instead stop forward altogether if there's another CC ahead. Or disable inter-CC collision altogether.
    2. Deterministic-ness. Moving from A to B, and server gets input and moves in server, then server sends back "correction" to clients. Say in client it hangs by the ledge, but in server it's actually a fall down. How to best handle it here.
    Teleport after distance threshold? I guess that's the first option. Sweep back to correct location? If there's pushing, client might push others and they need to be teleported again, etc
    3. Grounded/fall state dictated by server, perhaps? Client sends input, and local prediction, but they effectively can "fly-walk" until the server specifically tells them that they're now supposed to fall
    4. I dont have the asset yet. It's dynamic RB, does it use RB's gravity, or, knowing your K2D, this is just a move vector?
    5. Back to #1, what if i rea-ly want pushing or at least unit blocking. Ultimately i really wanna make MOBA (Dota) interaction with player/unit blockings. Another consideration is to drop jumping altogether (so, it's exactly Dota), but, is there a point getting this if you don't jump, then?

    Just some abstract stuff. The sale is ending in 2(?) days and i'm really on the edge of buying, but i just found out that it's dynamic RB
    Your K2D seems much more controllable for networked, actually. But this one, i need to consider a lot first..
     
  24. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    921
    @lightbug14 Hello, I've just started using this asset and I have come across an issue where the slope angle isn't calculated correctly when using a capsule or sphere for the character below 1.0. For example, we have a small character which would have a sphere radius of 0.6 and a 45 degree slope is reported as being 10 degrees by the Character Actor Component.

    Just wondering if there is something I missed or a quick fix I can implement?

    Thanks
     
  25. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi there:
    1. You can do this by putting all the characters into the static obstacle layer.
    2 and 3. Let me say that i'm starting with networking (a new world to me), so i'm in no position to give you an educated answer here, sorry. Also, i guess teleporting a character would not be enough, you will also need to change the state (depending on the situation of course). In order to do that i need to implement something else on the FSM (what i called the CharacterStateController).
    4. The gravity is fully controlled by the NormalMovement state.
    5. Could you give me an example of this?

    Sorry for that, i really do, i know the sale is finish by now, as i always say (forum, mails and in the CCP webpage): "if you need a quick answer please send me an email, is the fastest way".

    If networking is your deal (at least it seems like you know what you are doing), well, maybe this asset is not ready for that task, at least for now. The focus is right now a solid state based single player + integrate other packages (new input system, cinemachine, animation, etc).

    Hi there, to perform all the grounding stuff the character uses physics queries (spherecast, capsulecast, etc), also to have a lot of control (and prevent some small bugs) the bottom part of the capsule is lifted from the bottom a little bit, i called this BottomOffset (you can find this value in the CharacterConstants class). Try to playaround with this value to get the result you want. At least put something greater than 2 * Physics.defaultContactOffset (https://docs.unity3d.com/ScriptReference/Physics-defaultContactOffset.html), by default > 0.02f. I have to admit the default BottomOffset value is really high (i think 0.2 or something).

    Probably those 10 degrees are coming from the ground below that 45 degrees slope.
     
  26. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    921
    Unfortunately reducing that value didn't help. Increasing to 1 seems to work but that would create even more problems. The ground below the slope is flat. It's just a test scene at the moment and the slope goes from a cube to a plane so I have to assume that the angle error is due to a collider diameter of 0.6f. If I set the collider to a diameter of 1, all is good.
     
  27. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    mmm that's weird, send me the scene as a package (by email).
     
  28. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    171
    Hey @lightbug14, great seeing improvements being added and looking forward to the next update! Do you know if you expect a first person version added to the controller anytime soon? I was already able to achieve something similar by just zooming in all the way but I also saw it was on your TODO list at some point in the future.
     
  29. mckelynn

    mckelynn

    Joined:
    Dec 20, 2018
    Posts:
    22
    hi, just wondering if you had an ETA for next update? the stuff you talked about including looked exciting (ladders, ledges)
     
  30. F1nches

    F1nches

    Joined:
    Apr 26, 2018
    Posts:
    4
    Hi, is 1.1.0 out soon? I thought I read a post from a month or two ago saying it should be out in 2 days or something similar.
     
  31. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hello, ETA: after "The Winds of Winter" by GRRM ... haha i'm kidding.

    Yes, you are kinda right, i was about to release 1.1.0 in mid-april, but with the asset store april sales and eveything i was really busy, answering emails everyday, like 5 to 10 in a day! That said, a lot has been improved, and of course there is always a bug lurking around the corner, a better way of doing something, a suggestion/feedback from someone. Basically small things that help to improve the asset in a lot of ways for everyone.

    This "feature" release is kinda a big release, feature-wise it brings like 5 or 6 new things (i have a lot more, i don't want to include everything now), but one of the most important thing is does is improving the systems that are already there (the AI, the brain, the movement, animation, the rigidbody itself), of course you'll see this in much more detailed in the release notes. I think this version is far better than 1.0.5 in this regard, so hopefully the wait will worth it.


    I can't specify an ETA (i'm really bad with ETAs, just like GRRM), however i'm finishing two small things, and improving two or three animations (i'm an awful animator). Of course the documentation is being updated as well. Hopefully both will be ready soon, especially now that the sales are over.
     
    F1nches and mckelynn like this.
  32. WarmedxMints

    WarmedxMints

    Joined:
    Feb 6, 2017
    Posts:
    921
    I got it sorted thanks. My animator had updated the character model and it was no longer on the character layer.

    Although I did notice an issue. When selecting a custom Input Handler in the Character Brain, you cannot populate the field in the inspector. The info box states that the class must derive from CharacterCustomInputs which is a class that does not appear to be in the project.
     
  33. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Good to know!

    Yes i remember that, that was a very stupid mistake. What version are you using? i got this with 1.0.5.



    Remember that the input handler is a monobehaviour, add that component in the scene first (don't drag and drop from the project view).
     
  34. mckelynn

    mckelynn

    Joined:
    Dec 20, 2018
    Posts:
    22
    1- Would Final IK be compatible with this? I noticed that sometimes, especially on Square Planet, the character's feet would go below ground.
    2- Can wall walking be activated with a button press?
     
  35. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    217
    I had a chance to mess with it today, and I get the feeling that this asset is going towards "drag and drop, not a single line of code" setup rather than being a basic character controller that a programmer would want to use.
    I liked the basic setup explained in this documentation, but it no longer works since the CharacterActor script now depends on other tightly coupled components, like CharacterStateController, CharacterBrain, the inputs, etc... I don't need all that because I have my own custom code that would handle that.
    So for now I'm going to pass on using it and switch back to built-in crappy controller. I hope to see updates in the future that would make it viable for me. Keep up the good work because the code is still better than some $200 assets out there.
     
    Last edited: May 11, 2020
  36. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi,
    1 - I don't know how Final IK works, although there is support for IK in the current version (see the documenation, Character Animation), and by "support" i mean the classic Unity's IK stuff, nothing very complex here. The next version handles this within the character state (the NormalMovement state).
    2 - Once you have your state behaviour defined (wall walking, ladder climbing, etc) you can enter (exit) to (from) that state by defining the conditions you want (basic to intermediate C# is required). Once you are inside a state, you can do whatever you want. Wall walking is not included in the asset.

    Hello there, i understand, let me say that the "CharacterActor" (from the core) does not depend on those other components (implementation), it's the other way around (e.g. The CharacterStateController is a CharacterActorBehaviour). For instance, you can ignore the entire Implementation completely and create your own stuff on top of the character actor (the "character controller"). Is that "CharacterActorBehaviour" the problem?
     
  37. Cypras

    Cypras

    Joined:
    Oct 25, 2013
    Posts:
    56
    Could this be used to create a character controller similar to Super Mario 64? With the acceleration, the rotating when you turn rather than an instant turn, the sliding back and forth on 180 degree turns, etc?
     
  38. Abandon-

    Abandon-

    Joined:
    Sep 1, 2017
    Posts:
    2
    Can this asset be used to create a first person character controller for the player? I'm not seeing anything about it in the documentation.

    Thanks!
     
  39. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi there, yes you can, although 1.0.5 does not come with a first person character. The next version (1.1.0) includes a first person camera + movement, but for now this is using the classic invisible body approach.

    A first person character is:
    - first person camera = third person camera with a distance of 0 from the target.
    - the character always looking (setting its forward direction) towards the view direction. This can be done by handling yourself the "forward direction" vector of the character (character.SetForwardDirection(...) )

    There will be a more "complex" first person implementation in the future (more like the GTA's implementation of a first person character).

    Hi, If you know exactly how to (mathematically) get that behaviour working, then yes. In order to do this you'll need to create your own custom state. At the end of the day you will be changing a velocity and/or rotation, so in theory everything (movement-wise) is possible.

    The demo character uses the NormalMovement state, which is my own implementation of a third person character (script-based, not animation based). For the next version i fixed some problems with this state, but still it will always be like a generic multipurpose movement component (being the third person as a general case).



    Regards.
     
  40. IO-Fox

    IO-Fox

    Joined:
    Jul 14, 2014
    Posts:
    86
    Have an ETA on when to expect v1.1.0?
     
  41. bunnybreaker

    bunnybreaker

    Joined:
    Dec 10, 2013
    Posts:
    5
  42. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hello, version 1.1.0 is available now :)

    Please read the release notes for more info.

    TL;DR:
    - Unity 2019.3.5 or higher! It works just fine with 2018.4 (the previous version). I'm using 2019.3.x now, since i'm doing some work with the new input system ;).
    - Demo vs Implementation --> Most of the example components (previously in the Implementation part) have been moved to the Demo (e.g. states, scriptable objects, camera scripts, materials, etc ). Hopefully this will make much more clear what's part of the controller/system, and what's optional/demo content.
    - Better step up/down (configurable speed).
    - The Character rotation now works as you would expect (at least for 3D), meaning that the orientation of the character matches the visuals.
    - The character hierarchy is now much more "tolerable" (basically you can put your stuff wherever you want).




    - Root motion and IK support (Animator) per character state.
    - Ledge Hanging and Ladder Climbing states.
    - First person camera mode ( the last two weeks i received a lot of "How to implement a first person camera?" mails, so i decided to upload this with this update).
    - Custom AIBehaviours as monobehaviours (not part of the CharacterBrain anymore).
    - And of course -> Bug fixes!


    These modifications demanded a lot of improvements and redesign of some of the core components (Core and Implementation). So, this feature update is kinda risky, meaning that you will encounter some errors (which is totally fine for a feature update). For more information about the versioning scheme used read this.

    As always, test the new version separately, especially this one!



    Final note:
    If you are using 2019.4.0 you will get a warning related to the "Animator not playing an animator controller" o_O. This seems to be a 2019.4.0 bug (at least for now). I have already reported this as a bug a few days ago (at least this does not happen in 2018.x, 2019.1, 2019.2 and 2019.3).

    Here is the thread i created: https://forum.unity.com/threads/2019-4-lts-animator-is-not-playing-an-animatorcontroller.910535/
     
  43. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi there, you are completely right, this is available in version 1.1.0 (available now).

    The documentation is being updated from 1.0.5 to 1.1.0 (at least the "Fundamentals" are ready).

    Also (based on a lot of feedback) i'm working on a big "How to..." section (just like the one from the new input system...very cool). Basically a quick way for you to do something related with the asset (e.g. create a character, create your state, do something with Ik, make a sprite flip, etc), without needing to read pages and pages of documentation. I'm mentioning this now just in case you see some changes in the following days.
     
  44. bunnybreaker

    bunnybreaker

    Joined:
    Dec 10, 2013
    Posts:
    5
    Thanks. Glad to see an update. Gonna have a play with it now.
     
    lightbug14 likes this.
  45. dmarqs

    dmarqs

    Joined:
    Oct 16, 2013
    Posts:
    12
  46. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hello! thanks for the interest in the asset.

    1 ───────────────────────────────────────────
    By default you can do something like this (i made the tunnel with a bunch of boxes):


    Note that the gravity is calcualted based on a point (planet), not a line (tunnel). If you go to the edge of the tunnel the effect is much more obvious. The "up" is pointing towards the center of the tunnel (invisible object, "gravity center 2"), not away from it.


    So, by default you won't get a tunnel-gravity component or something like that, but close. If you need to customize this behaviour the vertical direction can be modified at any time. For instance, in the demo when you travel (using the numbers) the DemoSceneManager component is defining a new vertical direction (only that frame), among other things:
    Code (CSharp):
    1.      
    2.         characterActor.VerticalAlignmentDirection = someVector;
    3.  
    2 ───────────────────────────────────────────
    To be honest i never considered the NavMeshAgent into the equation, since this component is moving the character directly, which conflicts with what the CCP's CharacterActor does. Also most people use the NavMeshAgent because of the NavMesh (pathfinding), which is totally understandable.
    For example, in the demo the AI is using the NavMesh to create input actions (basically pressing buttons from a virtual device), but they are not NavMeshAgents at all. So, Do you want to use a NavMeshAgent just for the pathfinding? or there is something else?
     
  47. dmarqs

    dmarqs

    Joined:
    Oct 16, 2013
    Posts:
    12
    Hi! Thanks for your response. =)

    1- That's perfect! Thanks for your time! =D

    2- I actually never used navmeshagents, always used the A* asset, but I decided to give a try with a character following a path with a mouse/touch input that has 3d obstacles on the way, like moving platform, ledge hanging etc. Do you think it's achievable using what you show in your AI demo?


     
  48. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    Hi @dmarqs ,

    Yes it's achievable, but that's a big word, because anything is achievable in some way. To better understand the process, the AI character follows a target by:
    1. Defining a target (Transform)
    2. Then the path is defined, based on a NavMesh.
    3. The inputs (movement axes) are calculated based on that path.

    (So, no NavMeshAgent involved, at least in version 1.1.0)

    This is what i called the "Follow" AI behaviour (there are two components more, "Sequence" and "Wander"). The target is never modified by this component (in the demo the target is the player), meaning that you'll need to move the target using your own code (the asset does not include any of this). Basically:
    1.Detect the click event
    2.Fire a ray (raycast) in order to detect the contact point,
    3.target.position = contactPoint.
     
  49. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    316
    @lightbug14 Hi, can you explain "External Velocity" a bit? (I read the docs, but still confusing the algorithm behind). Btw, from 3D Scene demo, version 1.1, there is a small bug I found. When player is on the planet, the reference mode should be Towards, but Away instead, not sure though. Thanks.
     
    Last edited: Jun 27, 2020
  50. lightbug14

    lightbug14

    Joined:
    Feb 3, 2018
    Posts:
    126
    HI, yeah sure.



    If you set the velocity frame by frame (in your character state or character actor behaviour logic), this "externalVelocity" becomes useless, because your are defining the value (basically ignoring everything else). This can be useful if you want to receive a hit from some object and don't want to use the physics simulation way of doing thing. Instead, you use your own contact response logic (version 1.0.x did this).

    On the other hand, if you accelerate the character frame by frame (AddForce and/or add velocity), or maybe move the velocity towards a target velocity (e.g. NormalMovement state), this will affect the character movement.

    The reference mode is "away", because the character "up" direction is pointing away from the reference.
    In 1.0.x i was using "gravity", but this concept is more specific to physics, not related to the character rotation whatsoever. Also gravity involves a magnitude o_O, it was confusing.
     
    ikemen_blueD likes this.
unityunity