Search Unity

  1. 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

[RELEASED] Easy Character Movement

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

  1. ShiftedClock

    ShiftedClock

    Joined:
    Sep 12, 2012
    Posts:
    13
    Using Unity 2020.2.0b2 I get this Warning dialogue when clicking Import in the Package Manager window.

    The install instructions don't mention this part. Is this a known bug or possibly something new with 2020.2? I haven't tried it with older versions.
     
  2. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @ShiftedClock,

    Yes, it is normal, as it being distributed as a complete package in the unity asset store, and thus it includes a copy of project settings, however worth note this settings are not really required by ECM and can be ignored.

    Here I attach you the updated documentation to show how can easily import into existing projects.

    Best regards,
    Krull
     

    Attached Files:

  3. ShiftedClock

    ShiftedClock

    Joined:
    Sep 12, 2012
    Posts:
    13
    Thanks for the fast reply and updated manual, very impressive.

    Does this warning popup because the ProjectSettings directory is included? If so, it might be helpful to remove it from the asset.
     
  4. net8floz

    net8floz

    Joined:
    Oct 21, 2017
    Posts:
    31
    I'm not sure in what situation including random project settings would be desired I found this confusing. Is this a common asset practice?
     
  5. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    60
    Hello @Krull !

    Thanks a lot for the great asset :) I just got it and thus decided to adapt my current controller using it, so far so good (the examples are a huge help) but I have a question : what would be the preferred way of just setting the character's position in world space ? Is using 'transform.position =' fine, or would that leave some problems ? Thanks again !

    EDIT : Just to make things clearer, here is my current problem : when the character jumps and encounters a ledge, I want her to hang on to it, which I used to do by just lerping her position to the ledge. but right now your controller is taking her velocity into account, which means she keeps moving for a while (I used the allow vertical bool to switch to the hanging state). I guess I just a want a way to disable physics for a while and take full control.

    EDIT 2 : I found the Pause method in the movement script which is pretty much what I was looking for, so that's great, but now I have another question : how would I go about dynamically switching root motion on and off ? Because it seems quite the complex set up (with the component, the different bools etc.), and I'd like to just switch to root motion for one animation and then just switch back (I used to just use a state machine behaviour that would change my animator bool)
    Thanks a lot
     
    Last edited: Sep 13, 2020
  6. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @ShiftedClock and @net8floz

    About the project settings, those are included as part of the process while submitting it to the Unity Asset Store, unity add those by default as the package is listed on the store as a complete project, the only way to remove those is listing it on a different category on the asset store.

    I have planned for next version to list it on a different category so it will solve the settings issue.

    Regards,
    Krull
     
    ShiftedClock likes this.
  7. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @VincentAbert ,

    Glad you solved your previous issues, and yes pausing it basically turns the character into a Kiniematic Rigidbody so you can move modifying its position if needed.

    About the root motion, you can toggle it using the BaseCharacterController useRootMotion property as needed, however worth note that by default ECM will disable RootMotion when character is not grounded, however this can easily be modified in your custom controller if needed.

    Let me know if need further help.

    Best regards,
    Krull
     
  8. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    60
    Thanks for the answer ! I've tried a few things but I can't manage to use root motion in my situation, which is the following :
    when my character is hanging under a ledge, I want to trigger her 'getting on top of the ledge animation', which is controlled by root motion. With my old controller, all I had to do was to set the Animator apply root motion to true, and back to false. Now I have tried to set the controller userootmotion and applyrootmotion to true (not sure what the difference is btw, should I set both of them ?), tried to pause the movement script, tried to set the animator directly, but the animation doesn't use root motion... I thought it might be because of the not grounded state, as you just mentionned the controller would then ignore root motion, but I tried to comment out the "&& movement.isgrounded" part of the base controller, just for testing, and still had the same problem...

    Also, I noticed that using "(movement.isgrounded && !movement.wasgrounded)" to check wether the character just landed is a bit unreliable : every once in a while she will stay in her jumping state despite landing. Any idea where this might come from ?
     
  9. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @VincentAbert

    I understand your confusion about the useRootmotion and applyRootmotion properties, it works as follows:

    ECM allow the toggle of root motion velocity or physics velocity, as you can see in the demos, you can press the R key to toggle between root motion based movement or physics based movement.

    In order to enable root motion based movement you need to set the BaseCharacterController useRootMotion proptery to true.

    While using Root tMotion (useRootMotion == true) ECM will simply pass the root motion velocity to the CharacterMovement Move method as the animation will take full control of how to move the character. However by default ECM will only apply the root motion movement when the character is grounded, (as you can see in the BaseCharacterController Move method) and this is controlled by the applyRootMotion property.

    This is needed in order to disable the root motion movement to allow the character to perform the jump, fall, etc. This can easily be modified to match your game needs, overriding the Move method in you custom controller, and modify it to match your game needs.

    Code (csharp):
    1.  
    2. protected virtual void Move()
    3. {
    4.     // Apply movement
    5.  
    6.     // If using root motion and root motion is being applied (eg: grounded),
    7.     // move without acceleration / deceleration, let the animation takes full control
    8.  
    9.     var desiredVelocity = CalcDesiredVelocity();
    10.  
    11.     if (useRootMotion && applyRootMotion)
    12.         movement.Move(desiredVelocity, speed, !allowVerticalMovement);
    13.     else
    14.     {
    15.         // Move with acceleration and friction
    16.  
    17.         var currentFriction = isGrounded ? groundFriction : airFriction;
    18.         var currentBrakingFriction = useBrakingFriction ? brakingFriction : currentFriction;
    19.  
    20.         movement.Move(desiredVelocity, speed, acceleration, deceleration, currentFriction,
    21.             currentBrakingFriction, !allowVerticalMovement);
    22.     }
    23.  
    24.     // Jump logic
    25.  
    26.     Jump();
    27.     MidAirJump();
    28.     UpdateJumpTimer();
    29.  
    30.     // Update root motion state,
    31.     // should animator root motion be enabled? (eg: is grounded)
    32.  
    33.     applyRootMotion = useRootMotion && movement.isGrounded;
    34. }
    35.  
    As you can see in the above code, the root motion movement will only be applied when you enabled it (useRootMotion == true) and the character's state is grounded.

    About the landing state check, this is a reliable way to check it, if it is falling could be because of a 'desync' of the character's grounding state, causing its state not be up to date when you check the condition.

    In order to better help you, I appreciate if could contact me to support email, and if possible provide me a basic scene with your current issue, Ill be happy to take a look at it and find the causes of your current issues.

    Regards,
    Oscar
     
  10. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,340
    Hi, my project is using unity's new input system and seems that many errors are popping up.
    Is it possible to add support for unity's new input system.
     
  11. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @EmeralLotus ,

    Well, while ECM uses the default Unity Input system (the old one), ECM is not really tied to it and can be easily modified to support the new Input System.

    To acomplish this, in your custom controller, override its HandleInput method and add new Input code in there, for example:

    Code (csharp):
    1.  
    2. protected override void HandleInput()
    3. {
    4.     // Default ECM Input as used in BaseCharacterController HandleInput method.
    5.     // Replace this with your custom input code here...
    6.  
    7.     //
    8.     // For example, you can replace the above code to use the Unity NEW Input system as follows
    9.  
    10.     var gamepad = Gamepad.current;
    11.     if (gamepad == null)
    12.         return; // No gamepad connected.
    13.  
    14.     moveDirection = gamepad.leftStick.ReadValue();
    15.  
    16.     //... Add gamepad button inputs here
    17.     //etc...
    18. }
    19.  
    However worth note, the examples and other controllers will use old input system, so I suggest enable 'both' systems to avoid errors, and use the New Input System to develop your game following the above pattern.

    Regards,
    Krull
     
  12. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    407
    I was trying to implement a spring/bouncer object that propelled the character into the air without control for a short while. How do you recommend I do this? Adding directly to the rigidbody didn't seem to work well.
     
  13. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    407
    Are you planning to add ledge hanging to future editions, or should I look elsewhere for something like this?
    It makes a huge difference to older games like Mario 64.

    There's a great example of ledge hanging here
    https://www.patreon.com/posts/moving-kat-3-32716107
     
  14. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @dock

    About your questions:
    The best way to handle this is treat it like a jump, on your spring apply a jump impulse, however just like the jump, you need to tell the character is allowed to leave the ground, using the movement.DisableGrounding() otherwise the character will be pulled back to ground.

    Additionally, just like the jump (its variable height part), you can keep adding a light force or even reduce the gravity, or set the max fall speed to a low value, to ease the character falling.


    Thank you for sharing the link info, interesting! unfortunately I do not have planned to add it to the upcoming ECM version, as my main goal with ECM is to serve as a general purpose character controller where users can build its game mechanics on top of the existing ECM functionality.

    While I really can not promise it, if added some kind of climbing system, it would be as an optional add-on and no part of ECM, mostly because of above reasons.

    Regards,
    Oscar
     
  15. WryMim

    WryMim

    Joined:
    Mar 16, 2019
    Posts:
    25
    Thanks for the miracle asset!

    Need help.

    When I press the "throw" button, I need the player to turn towards the camera. What's the best way to do this?

    That is, not a rotation through X Y from the mouse. A method like Rotate (targetDirection) and the player turns there.
     
  16. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    117
    Root motion doesn't seem to work with this at all. The Demo scene (Custom Character Controller) doesn't switch between walk and run, the character constantly slides for both cases. The sliding is particularly evident if Walk Speed is set to 0.5 and Runspeed set to 1. Even with these settings, the animator parameter for forward speed remains at 0.999, causing the run animation to play despite being in walk.

    The Use Root Motion check box is true.
     
  17. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @WryMim

    Thank you :)

    About your question, the BaseCharacterController includes several helper functions to rotate the character:
    Code (csharp):
    1. /// <summary>
    2. /// Rotate the character towards a given direction vector.
    3. /// </summary>
    4. /// <param name="direction">The target direction</param>
    5. /// <param name="onlyLateral">Should it be restricted to XZ only?</param>
    6.  
    7. public void RotateTowards(Vector3 direction, bool onlyLateral = true)
    8.  
    9. /// <summary>
    10. /// Rotate the character towards move direction vector (input).
    11. /// </summary>
    12. /// <param name="onlyLateral">Should it be restricted to XZ only?</param>
    13.  
    14. public void RotateTowardsMoveDirection(bool onlyLateral = true)
    15.  
    16. /// <summary>
    17. /// Rotate the character towards its velocity vector.
    18. /// </summary>
    19. /// <param name="onlyLateral">Should it be restricted to XZ only?</param>
    20.  
    21. public void RotateTowardsVelocity(bool onlyLateral = true)
    In your case you could use the RotateTowards method, worth note by default an ECM character will rotate towards its current input move direction (BaseCharacterController UpdateRotation method), so in your custom controller, you can modify this method to rotate towards a given direction.

    Regards,
    Krull
     
    WryMim likes this.
  18. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @craigjwhitmore,

    About your question, yes the CustomCharacterController example does not change the animation based on character's speed when using root motion, however this can easily be modified as follows:

    In the CustomCharactercontroller Animate method, simply replace the line at 114:
    Code (csharp):
    1. // Update the animator parameters
    2.  
    3. var forwardAmount = animator.applyRootMotion
    4.     ? move.z
    5.     : Mathf.InverseLerp(0.0f, runSpeed, movement.forwardSpeed);
    with the following:
    Code (csharp):
    1.  
    2. var forwardAmount = animator.applyRootMotion
    3.     ? Mathf.InverseLerp(0.0f, runSpeed, move.z * speed)
    4.     : Mathf.InverseLerp(0.0f, runSpeed, movement.forwardSpeed);
    5.  
    this will enable walk / run with root motion as it does without root motion.

    Regards,
    Krull
     
  19. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    255
    Hello i have a question, how can i make Swimming with that Controller? I have take a Look in the documentation but i found not or iam blind. And the same for climbing a Lader. And a other question for the third person Controller how i can activate that the Controller will strafe and not lean and walk in a circle.
     
  20. craigjwhitmore

    craigjwhitmore

    Joined:
    Apr 15, 2018
    Posts:
    117
    That does change the animation between walk & run. Root motion still doesn't work. Just set walk speed to 0.5 and run to 1 and it'll be obvious.
     
  21. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @Pandur1982

    You can find the additional examples on the Walkthrough section, it includes many additional examples. About the ladder climbing example, its been released after the update so its not included in current 1.8 version, however you can find it here

    Regards,
    Krull
     
  22. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @craigjwhitmore

    Well with root motion basically you are controlling the animation with input, which in turn gives the desired movement velocity.

    The example works as commented above, however it still will clamp the given desiredVelocity to the speed property value as you can see in the BaseCharacterController Move method, so if using root motion, just set the speed property to your current animation speed value or just set it to a high value so the animation speed does not get clamped.

    Having said that, If your game is using mostly root motion, I suggest you override the Move method in you custom controller and modify it to match your game needs.

    Cheers,
    Krull
     
  23. rainmax

    rainmax

    Joined:
    Jan 31, 2018
    Posts:
    3
    Hi Krull!! This is a great asset! I like it. Just want to ask if you have plans to add a camera system? Seems like it is the only thing missing especially when using it in third person view. It would be great if it would have something that can focus on the player and avoid the obstacles/clipping.
     
  24. WryMim

    WryMim

    Joined:
    Mar 16, 2019
    Posts:
    25
    Hey. I just wanted to give my opinion.
    There is also a free asset in Unity Cinemachine, there you can make any version of the camera.
     
    Krull likes this.
  25. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @rainmax

    About your question, well I do not have planned to add a full featured camera component to ECM mainly because I would like to keep it focused on character controller, and there are many good camera solutions available which works with ECM.

    Having said that, what I have planned to add in future updates is as @WryMim said, include an example of how to integrate Unity Cinemachine with ECM.

    Regards,
    Krull
     
    Willbkool_FPCS likes this.
  26. rainmax

    rainmax

    Joined:
    Jan 31, 2018
    Posts:
    3
    Hi @Krull,

    Thank you for considering cinemachine. I understand the focus on character controller. I'm just thinking that It will be a good supplement for the movements especially for third person view. To have something that we can use as a base is better instead of making our own version of the camera.

    By the way here is a screenshot from the demo. Was wondering why is it setup like this by default?

    upload_2020-10-4_17-15-4.png

    I searched the manual and looked at the code and saw that these properties are public. But I'm just wondering also why I cannot see them in the inspector.

    isOnLedgeEmptySide
    isOnLedgeSolidSide

    When I switch to Debug in the inspector, I can see some properties like
    'isOnPlatform' but not all the other properties declared public.

    Regards,
    Rain
     
  27. khushalkhan

    khushalkhan

    Joined:
    Aug 6, 2016
    Posts:
    25
    It is great package, but just movement is not enough let's see if you can add melee or shooter etc logic to controller
     
  28. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @rainmax

    Well I could add it as an example, actually it includes an over shoulder example camera system example, and definitely should help you to get started with a third person like movement, you can find it in the walkthrough example # 13.

    The picture is using a ledgeOffset of 0.3 (capsule radius), this property is the maximum distance from the ledge (measured as the horizontal distance from the character's position to ledge hit point) a character can stand without falling, you can set it to 0, and it will fall when a ledge if found.

    Yes, those are properties, not fields and those properties are not shown in editor, well it can but need a custom editor to show those. Those properties are computed properties and are the result of the ground detection evaluation, think of those as a report of where the character is standing on.

    You can 'see' those if enable gizmos on your scene and keep selected your ECM character, when selected it will show its debug aid gizmos, in the above case, it will show a green circle at the character's foot position, showing its ledgeOffset radius.

    For example the gizmos will also show if character is grounded (green bottom sphere), red bottom sphere if not grounded etc.

    regards,
    Krull
     
  29. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @khushalkhan

    Thank you for your suggestion, however the main goal with ECM is to serve as a general purpose character controller, where users can build its game specific mechanics on top the default ECM functionality.

    Having said that I could consider developing some add-ons including those kind of mechanics without altering the main goal of ECM, a clean, lean a feature reach character controller to serve as a base for your game mechanics.

    Cheers,
    Krull
     
  30. SaeedPrez

    SaeedPrez

    Joined:
    May 10, 2017
    Posts:
    5
    Hi,

    I recently bought your asset and I'm trying to replace my current movement script, but I've ran into an issue.

    I have a character and ground tiles that push the player in a specific direction when standing on them (like a treadmill). To add the extra movement from the tiles I have overridden the CalcDesiredVelocity() method like this:

    Code (CSharp):
    1.     protected override Vector3 CalcDesiredVelocity()
    2.     {
    3.         var desiredVelocity = base.CalcDesiredVelocity();
    4.         desiredVelocity += this.extraMovement;
    5.  
    6.         return desiredVelocity;
    7.     }
    Let's assume the player's movement speed is 6 and the tiles push with 5 speed.

    When the player doesn't move, the player gets pushed as expected.

    When the player moves opposite the tile direction (6 - 5 = 1 movement speed), the player moves slowly in the opposite direction of the tiles just as expected.

    The problem is when I move in the tile direction (6 + 5 = 11 movement speed), the player moves like normal (6 movement speed). I have tried setting the literal speed to 20 and even higher but nothing seems to work.



    I have tried applying different types of forces and whatnot, but nothing gives the desired effect.

    Any idea how I can fix this?

    Edit:
    After some more testing, it seems the script clamps the speed to 6 which I have defined as movement speed in the inspector. So the question is how can I add external forces and go past the speed limit? At first I thought the actual speed limit was the mat lateral speed settings?

    Edit2:
    I found a way to make it work, I set the speed to 11 and then limit the speed from from the input to maximum 6. This way I can add extra speed up to 11.
     
    Last edited: Oct 11, 2020
  31. cursedtoast

    cursedtoast

    Joined:
    Apr 27, 2018
    Posts:
    12
    Is there any sort of crouch speed I'm missing by chance? Or is that something I should override and implement myself?

    For now, I just did an override of GetTargetSpeed from BaseFirstPersonController:

    Code (CSharp):
    1. protected override float GetTargetSpeed()
    2.         {
    3.             // Defaults to forward speed
    4.  
    5.             var targetSpeed = forwardSpeed;
    6.  
    7.             // Strafe
    8.  
    9.             if (moveDirection.x > 0.0f || moveDirection.x < 0.0f)
    10.                 targetSpeed = strafeSpeed;
    11.  
    12.             // Backwards
    13.  
    14.             if (moveDirection.z < 0.0f)
    15.                 targetSpeed = backwardSpeed;
    16.  
    17.             // Forward handled last as if strafing and moving forward at the same time,
    18.             // forward speed should take precedence
    19.  
    20.             if (moveDirection.z > 0.0f)
    21.                 targetSpeed = forwardSpeed;
    22.          
    23.          
    24.             // Crouch speed *** This part is custom ***
    25.             if (crouch)
    26.             {
    27.                 targetSpeed = (forwardSpeed / _crouchSpeedModifier);
    28.             }
    29.  
    30. // Handle run speed modifier
    31.  
    32.             return run ? targetSpeed * runSpeedMultiplier : targetSpeed;
    33.         }
    Though, I just realized I'll need another check to see if crouched before returning the modified speed factoring in running.
     
    Last edited: Oct 12, 2020
  32. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @SaeedPrez

    About your question, yes your approach is correct, as you noticed the given desiredVelocity returned in the CalcDesiredVelocity method, will still be clamped to the current speed property value, think of this speed property as the character's current state max speed.

    Another way you could handle this, is using external forces, I mean just apply a force (velocity change, impulse, etc), and this force act on the character unclamped by the desired, after all its just a rigidbody acting as a character.

    Regards,
    Krull
     
  33. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @cursedtoast

    Yes, by default it does not modify the character's speed while crouched, so no crouched speed property available. Your solution is correct, the idea is set the character's speed property to your character's current state max speed, as the above post, the speed property is actually our character's current state max speed value (should have named it maxSpeed :)).

    You can check if the character's is currently crouching using the CharacterBaseController isCrounching property. You can see a working example in the walkthrough example # 5 where we use the isCrouching property to animate the camera to perform the crouching animation.

    Regards,
    Krull
     
    cursedtoast likes this.
  34. my_little_kafka

    my_little_kafka

    Joined:
    Feb 6, 2014
    Posts:
    44
    Hello again!
    I really enjoy the asset, and I was able to simply change standard Unity's CharacterController to ECM components in order to my character controller to work again (of course I had to make small changes here and there and tweak the speeds). I noticed a small problem - if the Snap to Ground parameter in CharacterMovement is turned on, randomly the rigidbody's speed value will be freezed, even when I don't move the PlayerCharacter:
    upload_2020-10-13_15-48-44.png

    When it's "stuck", the speed is always equals to the Velocity's Y value. Another strange thing is that simply moving the camera with a mouse makes the speed of a rigidbody to fluctuate. I rewrote my CameraController script so it will change the rotation through the rigidbody, like in your implementation of a FirstPersonCharacter, and I think I did everything right - but even if I disable the mouse look, the speed still gets stuck sometimes (not always) simply by moving. If I disable the Snap to Ground parameter, everything seems to work fine. How important it is? Does it work the best with very fast characters? I don't notice any differences with it being turned on and off while running the example scenes.
    I don't use the base classes provided, but I went through the code (which is very a good experience, the code is very clear and easy to navigate) and simply converted my own CharacterController to ECM. Maybe I missed something important? The coordinates are
    Could this be because the code of my CharacterController doesn't call to FixedUpdate directly, but it catches a FixedUpdate event from a controller script (so I basically chain a lot of objects which control other objects, with the top object using actual Start, Update and FixedUpdate events which are being sent to the hierarchy)?
    If the ground snapping is not viable for ordinary moving characters, I would simply turn it off, as it seemingly works just fine, but I want to know if it's important to the whole collision system.
     
  35. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hello @my_little_kafka

    About your issue, I think it is related to the snap to ground used 1.8 version, it is position based (vs the previous velocity based), so even if your character is standing stills (no input velocity), the snap to ground will still pulling him back to ground, thats the tiny velocity in Y you noticed, however I noticed this snap to ground method could cause issues in some circunstances, so I decided to roll back to the velocity based method which is more flexible.

    I just finishing some minor bug fixes (in example scenes), before release it.

    Kind regards,
    Krull
     
    my_little_kafka likes this.
  36. dmarqs

    dmarqs

    Joined:
    Oct 16, 2013
    Posts:
    18
    HI,

    I'm really in love with ECM until now. =)

    Everything seems to work as expected.

    2 questions:

    1 - There is support for 'planet walk' like in Mario Galaxy?

    2 - I would like to avoid my character to fall off ledges, like if there is an invisible wall. Is there anyway I can verify if player is in front of a ledge and don't let him fall? Even that I had to add an invisible wall dynamically.

    Thanks! =D
     
  37. Krull

    Krull

    Joined:
    Oct 31, 2014
    Posts:
    144
    Hi @dmarqs

    About your questions:

    Absolutely, however not out of the box. The latest ECM update added support to rotate the character, previously was required to remain upright all time.

    The idea is to query the current surface normal, and align / rotate the character to follow the terrain contour, however its also necesary to align the gravity. You can check a similar approach in the included walkthrough example 8 - Orient Towards Ground Normals as it uses a similar approach.

    You can use the info provided by the CharacterMovement component (accessed in controller with movement property), this reports a lot of information about the 'ground' where character is currently standing on, for example: movement.isOnLedgeSolidSide, movement.isOnLedgeEmptySide, movement.ledgeDistance

    A rough approach is to downcast a fixed distance in front of your character, and if no 'ground' found, prevent its movement along its current direction.

    Kind regards,
    Krull
     
unityunity