Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[RELEASED] Easy Character Movement 2

Discussion in 'Assets and Asset Store' started by Krull, May 5, 2021.

  1. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    No problem, glad to help.

    Let me know if you have any further questions.

    Regards,
    Krull
     
  2. Cdy0774

    Cdy0774

    Joined:
    Dec 29, 2014
    Posts:
    9
    Dash Can't stop Hold Dash Key is a BUG?
     
  3. Kingblade

    Kingblade

    Joined:
    Jan 15, 2014
    Posts:
    14
    Hey Krull! Quick question

    Does the controller support enabling the player to not be able to fall off of ledges? (as if there are invisible walls or something of the sort)

    If not, do you have any suggestion as to where in the code I can extend the usage? (intuitively I think of the "CharacterMovement" script, but if you have anything better / more detailed that would be very helpful)

    Thanks :)
     
  4. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Mmm, not a bug but the current implementation, having said that as part of the incoming update (v1.1.0) worth say I simplified and improved the dash example so worth check it out once update is released.

    Regards,
    Krull
     
  5. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Kingblade

    Not yet, nope, if possible you use invisible walls using triggers and enabling the character to actually collide with triggers, that way, only the character will collide and those 'blocking triggers' wont affect other characters or rigidbodies. The downside is manually placing it.

    A possible solution is implement a kind of 'blind stick' where you sweep along the character's moving direction and see if hit something, can't fall so you are done, however if no hit, you downcast from that future position, if find ground, you are done, however if the downcast found nothing, it will fall so you halt the character's movement.

    The tricky part to implement a proper invisible-walls is compute the blocking normal so the character actually slides as if it's a real invisible wall and it's definitely something I have planned for future updates as this should be implemented in the core movement loop.

    Kind regards,
    Krull
     
  6. MegaMileyStudios

    MegaMileyStudios

    Joined:
    Aug 19, 2017
    Posts:
    72
    Hi there, I'm using ECM2 in my project with the new Input System but I keep getting this warning in my console in Unity 2021.2.7f1.

    Seems like this line

    Code (CSharp):
    1. if (EventSystem.current && EventSystem.current.IsPointerOverGameObject())
    2.     return;
    is causing issues here with the `IsPointerOverGameObject` call. Is there a way to get rid of this warning? I'm using version 1.0.1 and I've got both input methods enabled in my settings.
     
  7. MegaMileyStudios

    MegaMileyStudios

    Joined:
    Aug 19, 2017
    Posts:
    72
    I'm also trying to disable movement input when opening the player's inventory and whilst it mostly works, whenever I re-enable the input and move my mouse 1 pixel it jumps quite a bit (likely the difference between the center of the screen and the close button on the UI. Is there a way for it to not jump the camera rotation? This is how I've got my code right now


    Code (CSharp):
    1.  
    2.        private void DisableInput()
    3.         {
    4.             if (_firstPersonCharacter.GetMovementMode() != MovementMode.None)
    5.                 _movementMode = _firstPersonCharacter.GetMovementMode();
    6.             if (_firstPersonCharacter.GetRotationMode() != RotationMode.None)
    7.                 _rotationMode = _firstPersonCharacter.GetRotationMode();
    8.            
    9.             _firstPersonCharacter.SetMovementMode(MovementMode.None);
    10.             _firstPersonCharacter.SetRotationMode(RotationMode.None);
    11.            
    12.             Cursor.visible = true;
    13.             Cursor.lockState = CursorLockMode.None;
    14.         }
    15.  
    16.         private void EnableInput()
    17.         {
    18.             _firstPersonCharacter.SetMovementMode(_movementMode);
    19.             _firstPersonCharacter.SetRotationMode(_rotationMode);
    20.  
    21.             Cursor.lockState = CursorLockMode.Locked;
    22.             Cursor.visible = false;
    23.         }
    24.  
     
  8. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @MegaMileyDev,

    Yes, that's the culprit, as I think it was 'deprecated' in the input system as it returns last frame info, however honestly I'm not quite sure of an alternative at this time, as I need to further investigate it.

    about the disable input,

    The easiest way is first disable your character setting its movement mode to none, then in your input related functions (HandleInput and input action handlers), you check if IsDisable and do not process any input.

    E.g, in your custom character (the one extending FirstPersonCharacter)

    Code (csharp):
    1.  
    2. protected override void HandleInput()
    3. {
    4.     if (IsDisabled())
    5.         return;
    6.  
    7.     base.HandleInput();
    8. }
    9.  
    This way it won't call any input action commands (eg: SetMovementInput, Jump, StopJumping, etc...)

    Alternatively, you can make use of the OnMovementModeChanged method, to handle when a character enters or exits a movement mode, in your case check if is disabled (movement mode == none) or enabled, so you can enable / disable input actions accordly. For example:

    Code (csharp):
    1. protected override void OnMovementModeChanged(MovementMode prevMovementMode, int prevCustomMode)
    2. {
    3.     // Call base method implementation
    4.  
    5.     base.OnMovementModeChanged(prevMovementMode, prevCustomMode);
    6.  
    7.     if (IsDisabled())
    8.     {
    9.         // Entering NONE movement mode, disable input actions here
    10.     }
    11.     else if (prevMovementMode == MovementMode.None)
    12.     {
    13.         // Leaving disabled movement mode, re-enable input actions here
    14.     }
    15. }

    Cheers,
    Krull
     
  9. MegaMileyStudios

    MegaMileyStudios

    Joined:
    Aug 19, 2017
    Posts:
    72
    Unfortunate about the `IsPointerOverGameObject` one for now, hopefully there's a better solution for it in the future :)

    As for the disabling of the input, neither of those examples worked but I found out why and was able to fix (it in a less than ideal way imo). The issue is that the Input Action is set to report the Delta of the mouse movement and the offset between the close button for the inventory and the center of the screen is roughly 300, -300. No matter what kind of disabling you'd do it will always have that offset when you close the inventory (or some other random number once I add the ability to close it by pressing the inventory button again or the escape key) and thus would always cause some kind of jump unless you ignore that specific input data.

    This is my code that was able to fix it

    Code (csharp):
    1.  
    2. private bool _wasDisabledLastRequest;
    3. protected override void HandleInput()
    4. {
    5.    if (IsDisabled())
    6.    {
    7.       _wasDisabledLastRequest = true;
    8.       return;
    9.    }
    10.  
    11.    if (_wasDisabledLastRequest && GetMouseLookInput().magnitude > 0)
    12.    {
    13.       _wasDisabledLastRequest = false;
    14.       return;
    15.    }
    16.  
    17.    base.HandleInput();
    18. }
    19.  
    It will basically ignore any actual mouse input for the first time it's non-zero after the movement was disabled. If I didn't have the magnitude check in place it would still jump since this method is called every frame but only when you actually move the mouse does it report the data. After that it can perform the normal path again and the mouse will be in the center of the screen.

    This feels like the new Input System doing what it's supposed to do (reporting the delta between the last mouse position and the new one) but causing unexpected side effects for this particular use-case. (this might be solved by using the performed events rather than polling the data when needed but I'm not sure, it might still have the same issue just in a different spot and with more difficulty to circumvent)
     
  10. jupando

    jupando

    Joined:
    Nov 17, 2014
    Posts:
    9
    I'm thinking of purchasing ECM2 while it's on sale, but I haven't been able to see the ladder example yet in any materials or the demo. Can anyone share what that looks like? Also Krull, is that new version coming out this week or any day now? I was hoping to check it out.

    --- edit ---

    Decided to go ahead and purchase it so no help needed. Looking forward to new version too. I am noticing that the camera doesn't work in many of the examples though, including the Ladder Climb scene.
     
    Last edited: Dec 28, 2021
  11. Kingblade

    Kingblade

    Joined:
    Jan 15, 2014
    Posts:
    14
    Thank you for this reply!
    Do you happen to know how far along in the pipeline this feature is? Because this feature will likely be extremely helpful to me.

    Thank you very much for your help (and happy holidays!),
    Roee
     
  12. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @MegaMileyDev

    Ah I see, mmm have you tried the old-input examples? As this could probably be related that the new Input System does not implement any kind of dead zone by default, so this could be a cause.

    Either Way, happy to hear you were able to solve it.

    Cheers,
    Krull
     
  13. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @justinpando

    Thank you for purchasing ECM2!

    About the update, well I am finishing the new documents as this update is a pretty big one, and while I tried to minimize the breaking changes, there are a few.

    The biggest change was in the CharacterMovement component, basically a whole new version of it, and IMHO totally worth it.

    About the camera, is not that it is not working, as some examples just show mechanics and use the base Character class, in order to isolate the shown mechanic, however any examples are applicable with ThirdPersonCharacter, FirstPersonCharacter, etc.`

    About release, well you can rest assured v1.1.0 is coming really soon!

    Regards,
    Krull
     
    jimmygladfelter likes this.
  14. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Kingblade,

    Without giving any release date, it's planned for next update after v1.1.0 is released but honestly some months ahead as after a big update like 1.1.0, the following releases are mostly fixes and improvements, because no matter how much I test it before release it once released something could show.

    Thank you, and happy holidays for you too!

    Regards,
    Krull
     
  15. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi guys!

    I am very happy to inform you that I have submitted the new v1.1.0 update to the store and should be available pretty soon, so please stay tuned!

    In the meantime, I have updated the first post with all the newest information about this BIG update with updated documents and API References.

    Cheers,
    Krull
     
  16. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    598
    The new update looks amazing, thanks @Krull! I'm starting a new project today so I'll be using this as the foundation for character movement.
     
    Krull likes this.
  17. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    100
    This is great news @Krull Well done!!
     
    Krull likes this.
  18. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @dock,

    Thank you, happy to hear you like the new update!
     
  19. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Sapien_,

    Thank you, and thank you all for your support!

    Having said that, I do plan to release the new CharacterMovement component (eg: kinematic character controller / motor) as a separate package as this has been developed as a direct replacement to Unity's Character Controller, this new package is aimed to developers who prefer to build the own character movement on top of if without having to rely on Unity's Character Controller.

    Worth note Easy Character Movement 2 includes it and always will include it, so ECM2 users do not need to purchase this new CharacterMovement package as it's already included.

    Last but not least, worth note once released this new CharacterMovement package ECM2 price mostly will be increased, however it is still on sale, so :D

    Once again, thank you guys for continuous support and motivation!

    Cheers,
    Oscar (Krull)
     
    Sapien_ and Blatticus like this.
  20. Blatticus

    Blatticus

    Joined:
    Apr 10, 2019
    Posts:
    19
    @Krull ,

    Updated the package for a new project, and was surprised (in a great way) by the update! Really happy to see you step away from the Character callbacks; I would originally modify the CharacterMovement component to bypass those haha.

    A few questions:

    In your Character component, is there a reason you handle the state changes in LateFixedUpdate? Since they happen before updating the CharacterMovement, could such logic be handled in Fixed update instead?

    What's the motivation for adding jump forces AFTER calling CharacterMovement.Move() in LateFixedUpdate. From what I see, those forces are simply cached and added together until they are "released" during the next Move() call. Why not add these forces before the current Move() instead of building them up for the next LateFixedUpdate frame?

    I haven't looked into the new internals too deeply, so I may be somewhat misguided. Thanks in advance!
     
  21. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Blatticus,

    Yes :), I received valuable feedback regarding these callbacks so in this update I decided to simplify its usage.

    One of my goals with this update was to make the Character Movement component a direct replacement for Unity's Character Controller, so a complete isolation of the component was needed.

    For example, I am about to release a short video showing how to replace the Character Controller from Unity's Starter Assets with the Character Movement (actually pretty straightforward) component as their character motor. The same applies for any source code using Unity's Character Controller.

    Good question:

    Yes, the logic can be handled in FixedUpdate without any issues however this would have introduced additional changes to users so I decided to move the whole Move method to the LateFixedUpdate function so they just need to extend the Move method as before (OnMove).

    The reason behind calling the CharacterMovement.Move function in the LateFixedUpdate is to offer rock-solid physics interactions, as now you can jump on a fully simulated vehicle (eg: Edy Vehicles) and the character is able to use it as platform without you having to write any extra code for it. The same for any platform be it scripted, animated, etc. The only requirement is to update your platforms in its fixed update.

    Worth note, this is only needed if your game makes use of simulated physical objects as it's perfectly fine to call the CharacterMovement.Move in your Update or even in a custom update loop as you can see in the included Character Movement examples.

    Thats correct, the only reason is due to crouching state, as it uses an overlap to check if can stand up, it's better to call it after the CharacterMovement.Move so it has resolved any potential overlaps mostly against dynamic platforms, and since jumping state checks crouching state (e.g. CanJump) I moved both after, but honestly you can move jump and crouch or any other state before the CharacterMovement.Move without any real issues.

    Regards,
    Krull
     
    Blatticus likes this.
  22. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    100
    Hey @Krull, I know you just finished the update, however I am getting some errors. I sent you an e-mail with the errors. I would rather not make a new controller again as I want to get people to play test my game, however your updates would also fix some issues I have so I really want to get this to work.
     
  23. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Sapien_

    Please make sure to backup your project before updating.

    Yes, to update, please first delete the ECM2 folder from your project, and then import the ECM2 v1.1.0 pacage from the store as usual.

    This version presents some significant changes, so you will need to slightly modify your own characters if needed, for example, now all the system is using the EasyCharacterMovement namespace, pretty much like UnityEngine, so it's easier to use it.

    For a complete list of changes, please refer to the included Version 1.1.0 Changes file (in docs folder), as this will make it easier to update your custom character / controllers.

    Regards,
    Krull
     
  24. Mythran

    Mythran

    Joined:
    Feb 26, 2013
    Posts:
    83
    Hello @Krull,
    Sorry to bother with an issue discussed in the past but,
    you said previously that you would add ledge grab (climb) and vault in the examples.
    I was wandering if this is getting near in the list or if is still far.

    Character controller pro has a nice climbing system, that i've been using to test the scene.
    If you happen to know this system, are you aiming for something similar?

    Regards!
     
    jimmygladfelter likes this.
  25. Fabbs

    Fabbs

    Joined:
    Dec 2, 2013
    Posts:
    42
    Hi! Im using the new update and i am having a problem with physics push interaction not working in build, works fine in editor play mode. The standing force works in both editor and build.
     
  26. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Mythran

    Yes, the version 1.1.0 could not see much at plain-sight but honestly it's a big update and the underlying changes are huge and honestly it makes ECM2 more easy to work, extend and most important add bases for tick-based network simulations.

    Now this changes has been released, I can focus on adding more gameplay mechanic focused examples as part of following updates, and yes, vaulting, covering, ledge climb, etc are planned, just keep in mind those are released as examples to serve you a starting point but not a right out-of-the-box solution as they very game dependant.

    Regards,
    Krull
     
    Mythran likes this.
  27. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi Fabbs,

    Could you add a bit more information, are you using any custom code? Does it happen on default characters? Are you using mono or il2cpp?

    In the meantime I'll perform some tests and see if I can reproduce it.

    Regards,
    Krull
     
  28. Fabbs

    Fabbs

    Joined:
    Dec 2, 2013
    Posts:
    42
    Hi! I am using the flying example character code, with il2cpp. I can try with just the standard FPS character aswell.
     
  29. JP7878

    JP7878

    Joined:
    Nov 25, 2019
    Posts:
    5
    Hey All...I'm noticing some not-so-fluid rotation with the first-person prefab using a controller (especially noticeable when rotating very slowly), yet the third-person demo scene is super smooth...both on desktop and Android. I didn't see this with the original ECM in a prior project. Has anyone else had a similar situation?

    Krull...I've got to tell you; this is some amazing work man! I've been using ECM for the past year, and it's been great. Unity should purchase your work and include it as a standard package.
     
  30. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Fabbs

    Thank you for the bug report and your updated information, I was able to reproduce and isolate it. The cause is since the CharacterMovement now owns the enablePhsyicsInteraction, impartPlatformVelocity, etc and on release the flags are not fully initialized since the OnValidate, OnReset methods are not called.

    I plan to release a minor update for ECM2 mostly related to how it manages the deltaTime, implementing a cleaner and transparent way, among other minor fixes and will add a fix for this one too.

    Regards,
    Krull
     
  31. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @JP7878,

    Mmm, honestly not noticed but worth further investigation, does this happen when using the mouse? and please if you could try the included examples BUT using the old input system, as could be related to the new input system not used in the original ECM.

    Thank you very much, I sincerely appreciate your kind words! :D
     
  32. Fabbs

    Fabbs

    Joined:
    Dec 2, 2013
    Posts:
    42
    Fantastic, thanks!
     
  33. JP7878

    JP7878

    Joined:
    Nov 25, 2019
    Posts:
    5
    @Krull, thanks for such a quick reply! The mouse seems super responsive. I wasn't aware we could disable the new input system without removing the entire package (thanks for the tip), so I tried that just now in conjunction with the ECM2/Old Input Examples/FPS and I'm still getting the same results. But then it occurred to me I originally adapted the original ECM1 FPS MouseLook script to accommodate a gamepad's axes sometime last year and completely forgot about it...so I imported the controller (ECM1) from a previous project and everything's smooth again.

    Out of curiosity, under the ECM2/Old Input Examples/FPS controller I tried reassigning the MyCharacter script's mouse axes again to accommodate the gamepad's right stick instead, but as above it's still not super fluid. The camera doesn't inconsistently stutter like when you see a frame drop or anything...it's more like the rate of rotation is decreased (though I did try increasing that, but then the cam just moves too fast without adjusting the sensitivity to match).

    I hope that all makes sense. I'll look into the code further over the weekend to see if I'm missing anything.
     
  34. hm2337

    hm2337

    Joined:
    Jun 9, 2019
    Posts:
    9
    Is this a rigidbody-based controller (rigidbody-based movement)?
     
  35. Sapien_

    Sapien_

    Joined:
    Mar 5, 2018
    Posts:
    100
    Hey @Krull Before this update, I used collision events for certain mechcanics, now that this is fully kinematic, those don't seem to work anymore. Do you have any solutions?

    I saw "protected virtual void OnCollided(ref CollisionResult collisionResult);"

    But I can't seem to access it via playmaker
     
  36. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @hm2337,

    Thank you for your interest in ECM2.

    About your question, it used to be, however starting from current version 1.1.0 its now fully kinematic character.

    Regards,
    Krull
     
  37. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Sapien_

    Yes, unity's OnCollisionEnter method requires one object to be a non-kinematic rigidbody.

    For the current version, its replacement is to use the Collided event, it gives plenty of information to react accordly.

    Mmm, while I am not familiar with playmaker, in order to use the collided event, you need to subscribe to it (please take a look at the included events example). Additionally, you can use the Collided event to trigger a BroadcastMessage() or SendMessage() you probably can use with playmaker.
     
  38. externo6

    externo6

    Joined:
    May 31, 2021
    Posts:
    3
    Hey There,

    First of all really happy with ECM2, its integrated well into my project and made it much easier for me to just get on with creating my game, I have hit a stumbling block however which I didn't have with versions previous to 1.1.0, so now that this is a fully kinematic controller, my grapple script no longer works correctly as it uses spring joints to simulate hanging on a rope.
    What alternative can is there to simulate the spring joint for movement like rope swings etc?

    Apologies if this has already been said or other examples exist!

    Thanks
     
  39. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi externo6,

    I think you can make use of the SetPlatform function to 'attach' your character to your rope rigidbody, however could you develop a bit about your current implementation approach? I mean for the pre-kinematic version.
     
  40. externo6

    externo6

    Joined:
    May 31, 2021
    Posts:
    3
    Hi Krull,

    Thanks! I'll try that method, right now its just a line render, but creating an actual rope as a rigidbody then attaching via setplatform maybe a good method to proceed with.

    Essentially, I pretty much used the following script to achieve the grapplehook mechanic: FPS_Movement_Rigidbody/GrapplingGun.cs at master · DaniDevy/FPS_Movement_Rigidbody · GitHub

    Essentially:
    Code (CSharp):
    1.  void StartGrapple() {
    2.         RaycastHit hit;
    3.         if (Physics.Raycast(camera.position, camera.forward, out hit, maxDistance, whatIsGrappleable)) {
    4.             grapplePoint = hit.point;
    5.             joint = player.gameObject.AddComponent<SpringJoint>();
    6.             joint.autoConfigureConnectedAnchor = false;
    7.             joint.connectedAnchor = grapplePoint;
    8.  
    9.             float distanceFromPoint = Vector3.Distance(player.position, grapplePoint);
    10.  
    11.             //The distance grapple will try to keep from grapple point.
    12.             joint.maxDistance = distanceFromPoint * 0.8f;
    13.             joint.minDistance = distanceFromPoint * 0.25f;
    14.  
    15.             //Adjust these values to fit your game.
    16.             joint.spring = 4.5f;
    17.             joint.damper = 7f;
    18.             joint.massScale = 4.5f;
    19.  
    20.             lr.positionCount = 2;
    21.             currentGrapplePosition = gunTip.position;
    22.         }
    23.     }
     
  41. Garganturod

    Garganturod

    Joined:
    May 19, 2021
    Posts:
    22
    Hello,
    I'm noticing that the field _hasLanded never seems to be set to true in the CharacterMovement class. I'm using the ECM1_Demo right now.

    Originally, I was looking at the OnWillLand methods in the Character class and saw that isOnWalkableGround didn't seem to be getting set in a way I was expecting (isOnWalkableGround was true even in the air). So, I loaded up the ECM1_Demo.

    Am I misunderstanding how those fields/classes work?

    Thanks
     
  42. onefoxstudio

    onefoxstudio

    Joined:
    Sep 28, 2016
    Posts:
    191
    I was fooling around with 2022 beta; I stumbled on this warning:
    Capture d’écran 2022-01-19 à 08.01.05.png
    Looks like they've removed this totally in the new versions.
     
  43. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @externo6,

    I see, thanks for the updated information.

    I think you could follow the same approach, however instead of attaching the character's rigidbody directly, you create a placeholder rigidbody as your endpoint, and attach your character to this endpoint using the SetPlatform function.

    However its important to make sure you have the impartPlatformXXX flags enabled as needed otherwise it won't follow the 'platform' at all.
    .
     
    externo6 likes this.
  44. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Garganturod

    Could you develop a bit more on what you are trying to achieve?

    The _hasLanded field of the CharacterMovement component is for internal use only, however it offers a wide number of exposed ground-related properties and events as needed.

    For example, you can use the following snippet to check when a character has landed:

    Code (CSharp):
    1. if !(characterMovement.wasGrounded && characterMovement.isGrounded)
    2.   Debug.Log("LANDED!")
    or using the Character Landed event.

    I performed a test and yes, the onWillLand event is not being correctly handled due to the event trigger execution order.
    In the Character class, please change the OnCollided method as follows:

    Code (CSharp):
    1. protected virtual void OnCollided(ref CollisionResult collisionResult)
    2. {
    3.     // If found walkable ground during movement, trigger will land event
    4.  
    5.     if (!characterMovement.wasGrounded && collisionResult.isWalkable)
    6.         OnWillLand();
    7. }

    I will add the fix to the upcoming minor update.
     
  45. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @onefoxstudio,

    Well I would not worry too much for beta those changes, as ECM2 (actually Character Movement component) being fully kinematic, it won't affect it anymore ;)
     
    onefoxstudio likes this.
  46. MichelVictor

    MichelVictor

    Joined:
    Apr 15, 2018
    Posts:
    8
    Hey! I love the tool and it really easy and fun to play with meshes moving around, rotating and everthing just works perfectly. I really want to just create thousand of levels rightway. Unfortunately my programming skills are really bad and the only tool it make me able to finish a game was Adventure Creator. They have some integrations with other controllers, but not with this one, i tried to make my own script so i can control the character with AC but Im not skilled enough. Do you think you could create this link between AC and ECM2?
    There is some example here:
    https://adventure-creator.fandom.com/wiki/Kinematic_Character_Controller_integration
    https://adventure-creator.fandom.com/wiki/Third_Person_Motion_Controller_integration

    Basically I need to tell character to go to a specific point and turn to the direction I need after reach that point, usually I do that direct on the AC functions.
     
    Last edited: Jan 20, 2022
  47. Garganturod

    Garganturod

    Joined:
    May 19, 2021
    Posts:
    22
    Thank you for the update. _hasLanded was just something that I noticed in the debug inspector while investigating OnWillLand.

    Thanks again!
     
    Krull likes this.
  48. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @MichelVictor,

    Happy to hear you like it!

    About the integration, thank you for your suggestion, I will review it and see what's needed to integrate ECM2 with it, in the meantime, let me know if you have any further questions.

    Regards,
    Krull
     
  49. Broudy001

    Broudy001

    Joined:
    Feb 12, 2020
    Posts:
    70
    Hi @Krull,

    I'm working on a project where the player follows a spline, and I'm basing my implementation on the example, though I'm using Dreamteck splines. It worked perfectly when I'm grounded, but if I jump just before a turn then player goes off the line of the spline. I assume this is because of the way the in air movement is handled, is there a way I can have it continue along the spline even around a corner?

    Regards
     
  50. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    708
    Hi @Broudy001

    Mmm, I think this could be caused by some setting on Dreamteck splines. The example works by sampling the character's position into the spline position and using this position on the spline to create a 'chase' position so the character keeps following it, but the character's movement is free, just creating a follow position to update the movement direction.

    Possibly the dreamteck spline is not giving the correct position when the character moves away from the spline. However this is just a guess as I am not familiar with Dreamtek spline.

    Another possible implementation is similar to the ladder example, which is basically a path following, but the difference is the character's position is locked to the spline, or in other words a more fixed spline movement.

    Regards,
    Krull