Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Easy Character Movement

Discussion in 'Assets and Asset Store' started by Krull, Apr 21, 2016.

  1. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    CHANGE LOG

    Version 1.5

    - Unity 2017 support

    - MouseLook class can be extended, just like other Base controllers.

    - Minor bugs fixes.

    Regards,
    Krull
     
    malkere likes this.
  2. mookfasa

    mookfasa

    Joined:
    Dec 21, 2016
    Posts:
    46
    Is there anyway to make it so that the character moves relative to camera? Where in the code would I be able to modify the player movement.

    Similar to something like this.
     
  3. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hey Mookfasa,

    Absolutely, the best way to accomplish this, is transforming the input moveDirection vector, so it be relative to camera's view direction. ECM has a helper extension that actually do this.

    Code (csharp):
    1.  
    2. /// <summary>
    3. /// Overrides 'BaseCharacterController' HandleInput,
    4. /// to perform custom controller input.
    5. /// </summary>
    6.  
    7. protected override void HandleInput()
    8. {
    9.     // Handle your custom input here...
    10.  
    11.     moveDirection = new Vector3
    12.     {
    13.         x = Input.GetAxisRaw("Horizontal"),
    14.         y = 0.0f,
    15.         z = Input.GetAxisRaw("Vertical")
    16.     };
    17.  
    18.     walk = Input.GetButton("Fire3");
    19.     jump = Input.GetButton("Jump");
    20.  
    21.     // Transform moveDirection vector to be relative to camera view direction
    22.  
    23.     moveDirection = moveDirection.relativeTo(playerCamera);
    24. }
    25.  
    Please refer to the "Custom Character Controller Examples" (Examples/Scenes/) for a working example of it, and the CustomCharacterController (Examples/Scripts/Controllers) for its full implementation.

    Please let me know if need further help,
    Krull
     
  4. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    37
    Hey, I'm wondering if this controller would be able after jumping and before landing, perform a single use second jump (a double jump) and I'd also like to know if it might be possible to extend this controller to perform a ground stomp (as in Mario 64)?

    Would very much appreciate it if you could point me in the right direction to implement this using this controller.
     
  5. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    37
    Actually I just worked a way to do the stomp, though the double jump is certainly trickier for me.
     
  6. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello dohenderson,

    Not quite sure if this what you are looking for, but ECM actually comes with a 'unlimited' number of jumps, (mid air jumps), it defaults to 0 mid-air jumps, but you can use the Max Mid Air Jumps property (BaseCharacterController) to set the desired number of 'mid air' jumps, for example, setting it to 1, will allow a double jump.

    However, if you are looking for a kind of different jumps, pretty much like mario, where first jump is, short, second one is a little higher and third one is a big one, this is doable, however it will require to develop a custom character controller, extending the BaseCharacterController to match your game needs. If this is the behaviour you are looking for, please let me know it, so I can develop a custom character controller to help you to get started with it.

    Hope this helps, however if need further help, do not hesitate to ask

    Regards,
    Krull
     
  7. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    37
    Aw I completely missed that... Max Mid Air Jumps is exactly what I need.

    Cheers for getting back to me, your controller is awesome!
     
  8. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Great!, happy to help you

    Thank you, I am glad you like it! :)

    Take care,
    Krull
     
  9. BinaryOrange

    BinaryOrange

    Joined:
    Jul 27, 2012
    Posts:
    138
    Hi @Krull, I have a quick question.

    This series of scripts looks like exactly what I'm looking for, as the default CharacterController in Unity is proving lackluster to me at best right now. Anyway, one of my main mechanics I want to implement is flying, and how it will work is that the player will have a maximum height they can fly up to for a limited amount of time. Does ECM have anything like this built in already, and if not, would it be easy to add it in myself through a separate script?

    Also, I'm not entirely clear, does this use Rigidbody physics for everything? Thanks!
     
  10. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello Jeremy,

    Thank you for your interest in ECM.

    Regarding your question, yes ECM has built in support for fly movement, if you set the allowVerticalMovement, the character movement component (aka, character motor) will disable gravity and allow to move along the y-axis, thus enabling flight mechanic's, by other hand (and by default), if allowVerticalMovement is disabled, the character motor will treat the movement velocity 'flat' along ground normal.

    The best way to accomplish this, and my suggested way to work with ECM, is extend one of the included BaseControllers (BaseCharacterController, BaseAgentController, BaseFirstPersonController), and add your custom game mechanics here. In your case the fly mechanics, actually I have a basic example of a fly cam (which I expect to add in the upcoming update) which I could share with you if needed.

    Absolutely, in the end the ECM Character is a regular Rigidbody modified to behave as a character, so it is really to use and interact with unity physics.

    Hope this helps, however if need further help, please do not hesitate to message me (email support) or post it here.

    Kind regards,
    Oscar
     
    BinaryOrange likes this.
  11. BinaryOrange

    BinaryOrange

    Joined:
    Jul 27, 2012
    Posts:
    138
    @Krull, this asset is saving my life! I've been trying to get a proper feeling character controller going on my own for a couple of weeks and just couldn't do it. Best money I've ever spent.

    As for that example, is it possible for you to send me an example? I tried looking through the BaseCharacterController, and I'm not sure exactly where I should put my custom flying method, I'm afraid of breaking it! :p

    I'll have to take a look around in it when I have more time tomorrow, but so far I am loving what I'm seeing. Thanks so much for making a great tool!
     
  12. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I honestly haven't spent the time to dive deep into the problem but my characters get stuck in jump loops sometimes. Have you seen that before Krull? I don't have the custom controller on me right now to check... Something with the booleans getting out of order or something I suppose. If I jump again it clears.
     
  13. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hey @JeremyG, thanks for your comments and really glad you liked ECM.

    About the example, absolutely, just email me to the support email, so I can send you an example of it.

    Actually that is one of the best part of extending the BaseCharacterController, you don't need to directly modify it, instead you simply override its exposed methods in a custom controller and extend its core functionality to match your game needs without altering the BaseCharacterController source code.

    Please refer to the included 'custom' controllers to see how develop a custom controller.

    Hello @malkere, being totally honest, I have not seen that jump issue, or being reported of it, so please if you could tell me how to reproduce it, ill be happy to take a look to it.

    Anyway, I am currently working in an upcoming update which among other things will feature the much requested step support feature, plus an greatly improved ground detection (sweep ground), so the controller will land perfectly on 'ground', etc. So if you could help me reproduce this issue, ill surely will add the fix to the upcoming update.

    Regards,
    Krull
     
  14. BinaryOrange

    BinaryOrange

    Joined:
    Jul 27, 2012
    Posts:
    138
    OK, @Krull, I sent an email to the support email I found on your website as the Unity Asset Store didn't want to open the link properly!

    I will take a look at the scripts you mentioned and I can't wait to see what I can do with them. I haven't been this excited about a new asset in a while! :)
     
  15. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    In the override of Animate in my CustomCharacterController I'm using

    Code (CSharp):
    1. if (!movement.isGrounded)
    2.    animator.SetFloat("Jump", movement.velocity.y, 0.1f, Time.deltaTime);
    But I don't see anything calling to fix that with an else or a if (movement.isGrounded). That's probably code I added in myself afterwards... I'll try just adding an else in there when I'm not half-asleep tomorrow XD
     
  16. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello,

    @JeremyG I will take a look at the asset store email issue, thanks for let me know it. In the meanwhile I have sent you the working FlyCamera example script, as I commented in my email, it is pretty straight forward, extending the BaseFirstPersonController to enable the vertical movement of the CharacterMovement component.

    @malkere Indeed I did not notice any 'strange' with the code you kindly posted. Anyway I will dig into the code and try to see if can reproduce the issue.

    By other hand in the upcoming ECM version one of the new features, is that you can ask the controller the 'groundDistance' at any time, no mater if the controller is currently grounded, falling or in a jump. This can help to better control your airborne animation, by setting for example a minimum fall height where the airborne animation does not play.

    Take care,
    Krull
     
    malkere likes this.
  17. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Hey Krull, I've had some player reports of this and finally got it to happen on my machine. I'm pretty sure I can fix it, but here it is for your reference if you've never seen it:

    Code (CSharp):
    1. rigidbody.velocity assign attempt for 'Player' is not valid. Input velocity is { 0.656438, NaN, 0.929760 }.
    2. UnityEngine.Rigidbody:set_velocity(Vector3)
    3. ECM.Components.CharacterMovement:ApplyMovement(Vector3, Boolean) (at Assets/Easy Character Movement/Scripts/Components/CharacterMovement.cs:543)
    4. ECM.Components.CharacterMovement:ApplyMovement(Vector3, Single, Single, Single, Single, Boolean) (at Assets/Easy Character Movement/Scripts/Components/CharacterMovement.cs:620)
    5. ECM.Components.CharacterMovement:Move(Vector3, Single, Single, Single, Single, Boolean) (at Assets/Easy Character Movement/Scripts/Components/CharacterMovement.cs:747)
    6. ECM.Controllers.BaseCharacterController:Move() (at Assets/Easy Character Movement/Scripts/Controllers/BaseCharacterController.cs:580)
    7. ECM.Controllers.BaseCharacterController:FixedUpdate() (at Assets/Easy Character Movement/Scripts/Controllers/BaseCharacterController.cs:689)
    8.  
    probably this guy in CharacterMovement:522

    Code (CSharp):
    1. desiredVelocity.y = -Vector3.Dot(desiredVelocity, normal) / normal.y;
    Hitting a flat wall after a high angle might divide by zero. I'll see if I can catch it red handed.

    Yup. Caught it trying to divide by zero.

    Successfully tested as fixed:

    Code (CSharp):
    1. if (normal.y == 0) {
    2.    Debug.Log("dividing by zero");
    3.    desiredVelocity.y = -Vector3.Dot(desiredVelocity, normal) / 0.01f;
    4. }
    5. else {
    6.    desiredVelocity.y = -Vector3.Dot(desiredVelocity, normal) / normal.y;
    7. }
     
    Last edited: Feb 12, 2018
    Krull likes this.
  18. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Awesome @malkere! I really appreciate your help to fix this issue, Ill definitely will add the fix to the upcomming major update (which I expect to be realease in about 2 weeks at most)

    Take care,
    Krull
     
  19. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello, I am really happy to share with you this new MAJOR UPDATE (v1.6) for Easy Character Movement ,this has been submitted to store so should be available in a few days.

    In this new version (v1.6) I have completely reworked the ground detection component, adding support for a set of new great features, such as support for steps, the character can walk (if desired) on any surface up to 89 degrees; flat-base capsule bottom, Configurable ledge offset, Ground-snap, You can now query at any time the character's distance to the ground plus additional grounding info, and many more!

    In fact, this is the biggest update to Easy Character Movement ever! so expect some braking change, so please backup before update.

    Worth note that I have tried to minimize the upgrade process, as result of this all you must do to update your characters to v1.6 is replace your character's SphereGroundDetection component (which has been deprecated) with the new feature-rich GroundDetection component, and configure its new features.

    If you have any question please feel free to post it here or message me to support email, Ill be happy to help you :)

    Asset Store Link
    Updated Documentation

    Demos







    Here I attach the list of full changes:

    CHANGE LOG

    Version 1.6

    *** MAJOR UPDATE, BREAKING CHANGES. PLEASE BACKUP BEFORE UPDATE.

    - Added support for steps and completely improved ground detection / character movement components. Eg: The character can now walk (if desired) on any surface up to 89 degrees.

    - Replaced the ground detection component. The new implementation (BaseGroundDetection / GroundDetection) is a much more robust and feature-rich component, capable of detect, report and query multiple grounding cases.

    - The abstract class GroundDetection has been renamed to BaseGroundDetection.

    - The previous SphereGroundDetection, BoxGroundDetection and RaycastGroundDetection has been replaced with a new feature-rich GroundDetection component and marked as obsolete. This obsolete components will be removed in a following update.

    - The new GroundDetection component, automatically configures from your character's capsule collider.

    - Improved ledge handling, the new GroundDetection allow to configure a desired ledge offset, this set how close / far a character can stand on a ledge without fall down.

    - Implemented flat-base feature. When on a ledge, the CharacterMovement component will treat the bottom of your capsule as flat instead of rounded. This avoids the situation where characters slowly lower off the side of a ledge (as their capsule 'balances' on the edge).

    - Implemented ground-snap feature. This help to maintain the character on ground no matter how fast it is running and not launch of ramps.

    - As part of the new ground-snap feature, the platform support is much more stable on moving platforms, the character will maintain the platform no matter how fast it moves, or its friction settings.

    - CharacterMovement now correctly apply platform angular velocity when on rotating platforms. Exposed platformAngular velocity property.

    - Added new methods (ComputeGroundHit) to allow query 'ground' info at any time.

    - Implemented continuous collision detection, this greatly improve the character landing, no matter how fast the character is falling, it will always land safely.

    - Refactored all BaseCharacterController private fields to protected. This allow derived classes access them an implement custom jump logic, etc.

    - Added a new method UpdateRotation to BaseCharacterController, this helps to easily modify the default ecm rotation method (rotate towards movement direction).

    - New gizmos, GroundDetection now show if character is on a step, on a ledge 'solid' side, on a ledge 'empty' side, on valid ground, on invalid ground, and not on ground. Please reffer to documentation for a fully description.

    - Removed OnCollisionXXX events dependency.

    - Minor Bug Fixes.

    - Code refactored and cleaned comments and tooltips fixes.
     
    malkere likes this.
  20. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Quick update:

    V1.6 is Live!

    Regards,
    Krull
     
  21. mookfasa

    mookfasa

    Joined:
    Dec 21, 2016
    Posts:
    46
    Awesome really excited for this!
     
  22. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hey mookfasa,

    Hope you enjoy this new version :D

    Take care,
    Krull
     
  23. mookfasa

    mookfasa

    Joined:
    Dec 21, 2016
    Posts:
    46
    Have you ever given any though on adding a third person camera system?
     
  24. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello @mookfasa ,

    Sure thing, ECM by default does not include a third person camera system, as there are many specialized assets that do a great job, however adding support for a third person camera is pretty easy with Easy Character Movement.

    You will need to create a custom character controller extending the BaseCharacterController, this is needed because by default ECM, handle the input in world space and will rotate the character (BaseCharacterController UpdateRotation method) towards is moving direction, however this default behaviour can easily be extended or completely replaced to match your game needs.

    In this new controller, you need to overrides 2 methods, first HandleInput to transform the input move direction to be relative to character's orientation and then UpdateRotation, in this method we rotate the character with mouse or to match your third person camera roation.

    Here I show you a pseudo code:

    Code (csharp):
    1.  
    2. public class ThirdPersonController : BaseCharacterController
    3. {
    4.     private float _targetYaw;
    5.  
    6.     private float _yaw;
    7.     private float _yawVelocity;
    8.  
    9.     // Override ECM HandleInput method.
    10.     // Here we make moveDirection relative to character's orientation.
    11.  
    12.     protected override void HandleInput()
    13.     {
    14.         jump = Input.GetButton("Jump");
    15.  
    16.         moveDirection = new Vector3
    17.         {
    18.             x = Input.GetAxisRaw("Horizontal"),
    19.             y = 0.0f,
    20.             z = Input.GetAxisRaw("Vertical")
    21.         };
    22.  
    23.         // Tansform move direction to be relative to character's current orientation
    24.  
    25.         moveDirection = transform.TransformDirection(moveDirection);
    26.     }
    27.  
    28.     // Override ECM UpdateRotation method.
    29.     // This allows us to directly rotate the character as our game needs.
    30.  
    31.     protected override void UpdateRotation()
    32.     {
    33.         // Here we rotate the character's (along its yaw) using the mouse
    34.  
    35.         // Smoothly rotate the character's (along its Y-axis)
    36.         // using the horizontal mouse input.
    37.  
    38.         _targetYaw += Input.GetAxis("Mouse X") * 2.0f;
    39.         _targetYaw = Utils.WrapAngle(_targetYaw);
    40.  
    41.         _yaw = Mathf.SmoothDampAngle(_yaw, _targetYaw, ref _yawVelocity, 0.1f);
    42.  
    43.         // Perfrom character(CharacterMovement component) rotation,
    44.         // around its Y - axis(yaw rotation)
    45.  
    46.         movement.rotation = Quaternion.Euler(0.0f, _yaw, 0.0f);
    47.  
    48.         // However if your third person camera handles the rotation,
    49.         // and you want to match the character rotation to the camera's one,
    50.         // please use this section
    51.  
    52.         // Generate a target rotation from cameras current look direction
    53.  
    54.         //var targetRot = Quaternion.LookRotation(Camera.main.transform.forward, Vector3.up);
    55.  
    56.         // Interpolate character's rotation towards camera's view direction
    57.  
    58.         //var newRotation = Quaternion.Lerp(transform.rotation, targetRot, Time.deltaTime * 20f);
    59.         //movement.rotation = Quaternion.Euler(0.0f, newRotation.eulerAngles.y, 0f);
    60.     }
    61. }
    62.  
    Hope this helps you however if need further help, please contact me to support email, Ill provide you a fully working example of this third person camera.

    Regards,
    Krull
     
  25. mookfasa

    mookfasa

    Joined:
    Dec 21, 2016
    Posts:
    46
    Hey Krull,

    I am working in the FPS Base controller and I was wondering if there is a way to make the character swerve side to side when pressing the inputs. So if they were to walk forward they would make almost like a sine wave.
     
  26. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello Mookfasa,

    Sorry but I not really sure what you are trying to accomplish, do you mean disable strafe movement and make the character swerve? or are you trying to implement a head bob feature? If could provide me an example, Ill be happy to help you.
     
  27. mookfasa

    mookfasa

    Joined:
    Dec 21, 2016
    Posts:
    46
    If i was to press W the character moves in a straight line forward. What I want is to when I press W is for the character to move more in an S patter than a straight line. Would I just update the transform.translate?
     
  28. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hey @mookfasa

    The best approach for this is override the HandleInput method, and modify the moveDirection vector, something like this:

    Code (csharp):
    1. public float frequency = 5.0f;   // Speed of sine movement
    2. public float amplitude = 0.5f;   // Amplitude of sine movement
    3.  
    4. protected override void HandleInput()
    5. {
    6.     // Default input
    7.  
    8.     moveDirection = new Vector3
    9.     {
    10.         x = Input.GetAxisRaw("Horizontal"),
    11.         y = 0.0f,
    12.         z = Input.GetAxisRaw("Vertical")
    13.     };
    14.  
    15.     // Here if we are moving 'forward', we apply a sin wobble effect to move direction
    16.  
    17.     if (Math.Abs(moveDirection.z) > 0.0001f)
    18.         moveDirection += new Vector3(Mathf.Sin(Time.time * frequency) * amplitude, 0.0f, 0.0f);
    19.  
    20.     jump = Input.GetButton("Jump");
    21. }
    In this example, we apply a sin wave effect to moveDirection vector, this will make it to move in a 'S' pattern when character is moving forward.

    Hope this helps you, however if need any further help, please let me know it :D

    Best regards,
    Krull
     
  29. eXiin

    eXiin

    Joined:
    Dec 23, 2013
    Posts:
    63
    Does your system support MatchTarget?
     
    Last edited: Sep 22, 2018
  30. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello eXiin,

    Unfortunately no out-of-the-box, but ECM includes a fully commented / clean source code, so it can be added to match your game needs.

    Please let me know if can help you any further.

    Kind Regards,
    Krull
     
  31. baumxyz

    baumxyz

    Joined:
    Mar 31, 2017
    Posts:
    107
    Hello @Krull

    I'm very interested in your asset. I have a few questions before I buy.

    1 The character can stand on moving platforms. How do the platforms have to be moved? Can I also use an animation for this (Animation tab)? Or do I have to use rigid body movement via script?
    2. Is a super fast collision detection possible? Or can it happen that the character flies/falls through the wall at higher speeds?
    3. Character animation is also possible I have seen. But in your examples everything is with Root Motion. Probably a stupid question, but without Root Motion everything should work fine as well, right?
    4. Do you plan to support this asset in the future or to develop it further for future Unity versions? Unfortunately, I have had bad experiences with other assets in the past. Support and further development is unfortunately not always and permanently given.

    Otherwise really a nice asset and I would love to use it in my game. :)

    Best Regards
     
  32. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello @baumxyz

    Thank you for your interest in ECM.

    About your questions:
    Absolutely, You can move the platforms by code as I do in the included examples, or by animation, if moving by animation, the only requirement is set the Animator update mode to Animate Physics.

    By default ECM use a discrete collision detection, however you can set the Rigidbody to continuous / continous dynamic detection for a improved collision detection, additionally ECM comes with a set of functions to 'sample' the world, like overlaps, casts and sweep test in order to detect if a character can move through the world.

    Yes, it works with and without root motion, actually ECM implements a very flexible friction based movement which allow to tweak your character movement as your game needs.

    I understand your position here, actually I have had some bad experiences in store too, so I am very committed with my ECM asset and with my customers, as you can see by many ECM happy customers :)

    Hope this helps you, however if need further help, please let me know it.

    Best regards,
    Oscar
     
  33. baumxyz

    baumxyz

    Joined:
    Mar 31, 2017
    Posts:
    107
    Thank you very much for your answer. This means that the asset will work with 2018.2 and that you plan to adjust your asset for future versions?
     
  34. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello @baumxyz,

    That's right, actually ECM works with unity 2018.2 out of the box, and I plan to support it in a long term. In the store it shows 2018.1 mostly because I upload one package for each unity major release (eg: 2017.1, 2018.1, etc).

    Please let me know if need further help.

    Take care,
    Oscar
     
    baumxyz likes this.
  35. baumxyz

    baumxyz

    Joined:
    Mar 31, 2017
    Posts:
    107
    Thank you. Answered all my questions :)
     
  36. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Excellent! glad I was able to help you :)

    Take care,
    Oscar
     
  37. Filhanteraren

    Filhanteraren

    Joined:
    May 14, 2014
    Posts:
    47
    Hi, Just bought the asset and so far I like it, very well made asset.

    I have a question of what would be the best practice to make the character rotate while jumping?, something like a back or front flip that you can control like a snowboard game.

    Thanks
     
  38. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hi @Filhanteraren

    Thank you for your purchase and kind comments about ECM, greatly appreciated!

    My suggested method, is rotate your model by animation eg: a pre-defined inplace backflip animation here you can make use of the "Root transform position Y" and use feet position so the character's capsule moves vertically according to feet while in midair.

    Alternatively you can rotate your character's model by code, modifying its transform, and leave the character vertical. The reason of this, is because in the current ECM version, it wont allow to rotate the capsule, as it expect it to be vertical aligned.

    Please let me know if need further help.

    Kind regards,
    Oscar
     
  39. enlite

    enlite

    Joined:
    Feb 27, 2017
    Posts:
    19
    Hi,

    How can I implement strafe for third person controller? are there sample project with animation for me to study?

    Thanks in advance.
     
  40. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello @enlite

    ECM package does not includes a third person example, mostly because it is focused on character movement and no pretend to add a full third person camera controller, as there are many feature-rich on store.

    Having said that, please contact me to support email, I'll be happy to set up a basic example template to help you get started with a third person / over shoulder camera movement.

    Best regards,
    Oscar
     
    Last edited: Nov 13, 2018
  41. enlite

    enlite

    Joined:
    Feb 27, 2017
    Posts:
    19
    Hi Oscar,

    Thankyou for creating a sample template for me, I have downloaded and will give it a go. Much appreciated.

    Ken.
     
  42. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hey Ken,

    No problem at all :), please do not hesitate to message me if need any further help.

    Regards,
    Oscar
     
  43. Pascal_NotVeryMoe

    Pascal_NotVeryMoe

    Joined:
    Sep 11, 2018
    Posts:
    6
    Hello Oscar,

    I'm currently looking at various character controllers on the asset store and came across yours. It looks very well made and it being a physics-based controller is really interesting but I'd really like to see a playable demo of some kind. Would it be possible to get a build of one of the example scenes? Apologies if I missed it and no worries if not, I'll keep reviewing footage instead.

    Either way, I had two other questions. How does it act with other rigid bodies? ie. Can you push things around / be pushed around? Also, you don't have to give me a definite answer here, but, how much work do you think it would be to modify it to / or does it already support an arbitrary gravity/up direction?

    Thanks for your time,
    Michael
     
  44. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello Michael,

    Thank you for your interest in ECM.

    HERE I created a windows build for the ECM Demo scene so you can try it :)

    About your questions, yes it is Rigidbody based and can interact with other rigidbodies out-of-the-box without any additional work or settings, you can push other objects and be pushed by other characters / rigidbodies and this can be fine tuned using the rigidbody mass and the character movement friction settings.

    The current ECM version does not support arbitrary gravity direction yet, it is a planned feature but have not been fully implemented yet, worth say, that in current version (1.6) update I added a lot of the base functionality required to support this feature, but as I commented It is not yet implemented, so adding this feature is doable in the current version but unfortunately not in a easy / simple way.

    Hope this helps you, however if have any further questions, please let me know it.

    Kind regards,
    Oscar
     
    Last edited: Nov 16, 2018
    Pascal_NotVeryMoe likes this.
  45. Pascal_NotVeryMoe

    Pascal_NotVeryMoe

    Joined:
    Sep 11, 2018
    Posts:
    6
    Hello Oscar,

    Thank you very much for the demo and information, I really appreciate it. Feels even better than it looks.

    Definitely looks like I've got something to purchase come pay-day.

    Thanks for your time,
    Michael
     
  46. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hi Michael,

    Excellent!, glad you liked it :D

    Regards,
    Oscar
     
    Pascal_NotVeryMoe likes this.
  47. poa123

    poa123

    Joined:
    Jul 13, 2018
    Posts:
    22
    Hi @Krull!

    I am very interested in your asset... i am trying to build a Rigidbody FIRST PERSON controller for months, without success (i am a little paranoic with smooth movement).

    I have some questions to be sure i am buying the answer to my needs :)

    1) The jitter problem i mentioned... it happens when looking to a object, then moving the character to the side and rotating the camera horizontally to keep looking at the object... the object always appears to jitter, even a little (paranoic, i know)...
    - i need to know the behavior of this asset in such situation... in the videos it looks very smooth, but i need to be sure ;)
    - in UE i solve the same problem enabling the default "camera rotation lag" (interpolation) option on the camera´s spring arm... do you have some kind of interpolation like that in your FP camera rotation, to smooth the movement? I believe this is the key to solve the problem, even if i have not yet achieved it by myself in Unity.

    2) How physics objects (like cubes with a rigidbody) behave being "pushed" by the character?

    3) Do you think it your asset would be a good fit on a TRUE first person scenario (where the player can see the body)?

    4) To answer my questions, a playable demo would be very good :)

    Thanks a lot for your time!! Congrats for your great asset!
     
    Last edited: Nov 21, 2018
  48. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Hello @poa123

    Thank you for your interest in ECM!

    About your questions:

    The default ECM BaseFirtsPersonController comes with two rotation methods one 'smooth' use a predefined 'lag' to smooth mouse movement even more, and a default one which pass the mouse input without additional interpolation, however worth note, internally ECM (being based on Rigidbody), uses Rigidbody.MoveRotation to rotate the character, so unity will generate a smooth transition between the two rotations.

    Yes, you can push other objects around or other characters or be pushed by other rigidbodies, this behavior can be tweaked using the rigidbodies mass and / or the character friction properties.

    Yes, however worth note here ECM does not include any built in code for this as this is focused on character movement and to serve as a base to build your custom game mechanics on top of it. Having said that, ECM is really flexible and It was built from the ground up to be extensible, so users can add their custom game code easily.

    You can download the ECM demo here

    Thank you! please let me know if have any further question.

    Kind regards,
    Oscar
     
    Willbkool_FPCS and cfree like this.
  49. poa123

    poa123

    Joined:
    Jul 13, 2018
    Posts:
    22
    Thanks! I will buy the asset ASAP :) Great demo!
     
  50. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    762
    Thank you! Please let me know if need any further help.

    Take care,
    Oscar