Search Unity

[Released] Character Movement Fundamentals - A Rigidbody-based Character Controller

Discussion in 'Assets and Asset Store' started by JanOtt, Jul 1, 2019.

  1. Pixitales

    Pixitales

    Joined:
    Oct 24, 2018
    Posts:
    177
    Thanks, i am not good with writing camera scripts. I try cinemachine. I could add cinemachine component and set it to do nothing and let the camera controller do the work. I let you know if that works.
     
  2. Braanflakes

    Braanflakes

    Joined:
    Jan 30, 2015
    Posts:
    1
    Hey there! Just purchased the asset and I'm loving it so far. Is there any chance you'd add sprinting and crouching support? I've been tweaking the code over the last few hours to add in both, however it's very patchwork so it'd be cool to see those options natively.
     
  3. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    I might eventually add a few more specialized controller scripts to the package in the future, like some kind of "advanced movement controller" that includes built-in crouching and sprinting.

    Right now my main priority is streamlining all the existing scripts and get everything as stable as possible for version 2.0 - so any new features will have to wait until then.

    However, if you need any assistance or help with your custom implementation, you can always contact me at support@j-ott.com and I'll try my best to help!
     
    Braanflakes likes this.
  4. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    62
    Hey @JanOtt any updates we can look forward to? I'm pretty excited about the stuff you've mentioned will change in V2. Do you have any other assets you are working on that we can start saving up for? :)
     
  5. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Hi toddkc,

    I'm currently finishing up the manual and doing some final checks, but apart from that, version 2.0 is pretty much ready to go. I'll try to upload the update in the next few days, if all goes well.

    After that, Unity will have to review the new update, which can take anywhere from a few days to a few weeks.
    Thanks for asking, but (at least for now) I don't have any new assets planned. If I do, I'll be sure to make some sort of announcement in this thread, though!
     
    Last edited: Feb 17, 2020
    toddkc likes this.
  6. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    391
    @JanOtt I'm excited to see what you have with 2.0! Thanks for your hard work.
     
  7. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Thanks @dock! The main goal for version 2.0 was to restructure and streamline all the existing code - along with a few new features that users have been frequently asking for (namespaces, separate input scripts).

    I'll post a more detailed breakdown here about all the changes and additions as soon as Unity finishes reviewing the asset.
     
    slimshader, BlackKitty07 and toddkc like this.
  8. RainerBk

    RainerBk

    Joined:
    Aug 1, 2015
    Posts:
    1
    Hello, I wanted to ask a question how can I make the gravity of a planet? With this extension?
     
  9. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Hi!
    All controllers in the package can be rotated at runtime (by just directly modifying the transform's rotation or by using the 'rigidbody.MoveRotation' function), so for a "planet" setup, I'd recommend writing a simple script that continuously rotates the character so it's 'up' axis aligns with the vector between the character and the planet's center.

    If you're interested, please feel free to contact me via the support email (support@j-ott.com) and I'll help you set up an example scene and go more into detail!
     
  10. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    146
    Yey, namespaces!
     
  11. BlackKitty07

    BlackKitty07

    Joined:
    Dec 12, 2019
    Posts:
    2
    Version 2.0 is up on the assetsore... will try it later.. Thank you @JanOtt
     
  12. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Quick update: Version 2.0 has just been accepted by Unity and can be downloaded at the Asset Store now.

    VERY IMPORTANT:
    This new version makes a few major changes to the package, so any scripts written for older versions (1.3 and below) will most likely not be 100% compatible! Please make sure to make safety backups of your projects before trying to import the new version!
    GENERAL:
    - Implemented namespace for entire code.
    - Renamed 'Resources' folder to 'Source'.
    - Fixed unnecessary memory allocation in some scripts.
    - Added (inspector) tooltips to some variables.
    - Some minor code improvements to improve readability.

    MOVER:
    - Overhauled and simplified mover inspector UI. Mover now supports proper editor undo/redo.
    - Streamlined mover layermask system. Mover now automatically uses the same layermask for raycasting as its gameobject's layer (as set in the physics settings).
    - Added (optional) ceiling detection script. This script can be attached to any object with an 'Advanced Walker Controller' script and will register collisions with the ceiling using the rigidbody's 'OnCollision' functions.
    - Added functions to change mover collider dimensions at runtime via script (see manual).

    CONTROLLERS:
    - Separated input handling from controller scripts. Input is now handled by a separate script attached to the same gameobject. This makes implementing custom input a lot easier.
    - Added two example input scripts for character movement (keyboard and gamepad controls).
    - Added two example input scripts for camera movement (mouse and gamepad controls).
    - Restructured controller script inheritance. All controller scripts now extend an abstract base controller script, 'Controller'. By extending from this script, users can easily use all the secondary scripts with their own custom controller scripts.
    - Controller scripts now have a 'Camera Transform' field. If assigning a camera transform, the controller will now move relative to that camera's view.
    - Merged 'Camera Walker Controller' and 'Basic Walker Controller' into a single controller script, 'Advanced Walker Controller'.
    - Added 'Simple Walker Controller', a very simple example controller script.

    PREFABS & SCENES:
    - Added two simple controller prefabs (located in Prefabs > Controller > Simplified).
    - Added a new example scene ('ExternalCameraScene') to demonstrate a possible controller setup where the camera is a separate gameobject as the character.

    MISC:
    - Added a generic 'Turn Toward Transform Direction' script as an alternative to the existing 'Turn Toward Camera Direction' script.
    - Added 'RotateObject' script, which is used in the new 'ExternalCameraScene'.

    That's it for now! If there's any questions about any of the new changes, please feel free to ask in this thread and I'll go into more detail!

    And as always, you can contact me via email (support@j-ott.com) anytime as well.
     
    Last edited: Feb 25, 2020
    toddkc likes this.
  13. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    391
    I just tried it the demo scenes, and it's a huge improvement, great work! Separating out the input and allowing external cameras will make a huge difference to my use of this asset. Thanks for your hard work and continued support!
     
  14. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Thanks! Glad to hear you like the new changes, @dock!
     
  15. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    62
    @JanOtt I also LOVE the update. I made a VR controller with this that can switch between 1st and 3rd person, and I was worried about the amount of work it would take to update, but it was super easy. Thanks!
     
  16. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Thanks, good to hear that!
     
  17. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Hi everyone!

    I'm currently making a list of possible topics/questions about the package, that I can cover in short videos (5-10 minutes) each. The plan is to upload these videos on Youtube as I finish them.

    So if you have an idea for a topic, please let me know either by commenting in this thread or via email (support@j-ott.com)!

    I can't promise I'll get to all of them, but I'll definitely try to cover the most requested ones, if I find the time.
     
  18. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    62
    I would love to know how you work through the logic/math for some of the features. That's what I struggle with, and why I bought this. Something you make look so simple like the gravity trigger spaces in the demo I would struggle with endlessly. Maybe that isn't a short video, but if you do one where you add a feature please talk through the logic in the code. I would love that more than 'change this setting on this prefab to do this' type stuff.
     
  19. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    Yes, that might be tricky to fit into a video, unfortunately. Generally speaking though, most of my programming workflow heavily relies on sketching ideas out on paper and lots of unit testing.

    By the way: Are you referring to the 'FlipAtRightAngle' script, specifically? If you have any specific questions about that, please feel free to contact me via email and I'll try my best to answer them.
     
  20. toddkc

    toddkc

    Joined:
    Nov 20, 2016
    Posts:
    62
    I don't have specific questions about that script. Before I found your asset I was making a prototype for a game that did exactly that. I tried various methods of rotating the player vs rotating the world around the player, and spend months on it and never got it working properly. Then found your asset where you have that in a very easy, elegant solution. Being able to do that (for whatever purpose, like wallrunning, or swimming, or flying, or whatever) in a clean, modular way like you have done is something I would love to get better at. I do not ever sketch on paper, maybe I need to try that....
     
  21. unity_lJaPVdg5SsQ6FA

    unity_lJaPVdg5SsQ6FA

    Joined:
    Feb 13, 2020
    Posts:
    1
    So I'm trying to implement my own character controller (I unfortunatly don't spend any money on any tutorials or in game purchuses so that's why I haven't bought this package). I think It's going pretty well but my character can't move while standing on a moving platform (that also moves, the player can move when the platform stops at the ends). Totally understand if I have to buy this package to get help from here but I would really appriciate getting help with this. Is it that the rigidbody.movePosition doesn't work when the player is parented to a moving object or is it something else?
     
  22. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    You should probably start a thread in the 'Physics' subforum (https://forum.unity.com/forums/physics.78/) for that.
    This thread is only intended for any news, questions and announcements concerning the 'Character Movement Fundamentals' package.
     
    DeclanMerry, Jorlman and toddkc like this.
  23. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    I've just finished setting up a basic Discord server specifically for the package, for anyone interested:
    Please feel free to discuss the package in the #general with other users!
    And if you have any specific questions about the package or need technical support, you can of course always reach me at support@j-ott.com!

    Little disclaimer: I'm still quite new to Discord (and managing Discord servers), so if you have any suggestions for the server, please feel free to let me know!
     
  24. gamedeveloper145

    gamedeveloper145

    Joined:
    Thursday
    Posts:
    1
    hello, great asset, I just want to know is it possible to use AI with your asset, if so how can I do it.
    Thank you in advance
    Edit: if you can, please show me how to make it work with A* pathfinding asset, that would be great.
     
    Last edited: Mar 26, 2020 at 2:43 AM
  25. JanOtt

    JanOtt

    Joined:
    Apr 23, 2019
    Posts:
    79
    It's definitely possible to implement AI controllers using the package, but you'd probably have to write a custom controller script for that. You might want to check out chapter 8 (page 37) in the user manual, for a quick introduction on how to code custom controller movement.
    Of course, if you run into any problems, please feel free to contact me at support@j-ott.com anytime!

    Unfortunately, I don't have a lot of experience with pathfinding (yet), but if you have any specific technical questions, just feel free to contact me and I'll do my best to help!
     
unityunity