Forum rules - please read before posting.

Direct Control & floating/suspended character after inclines

I have a problem I've been trying for days to solve. I made a mecanim character. The mecanim works fine, but after he runs up inclines, -like up a hill or down a slope- the character will remain suspended in midair instead of remaining grounded. The character also softly floats downwards if I move forwards (or any direction). I have tried the gravity settings, and many, many other things.  He has attached to him a rigidbody, capsule collider (no, it's not too far up or too far down), paths script, and a player script. I am using direct control method and selected the Unity navigation option. My mecanim parameters use speed. I am applying root motion in the mecanim component. Please let me know if further details are needed.


  • I'm in a similar situation. I think a AC-Mecanim tutorial would be very helpful in this case...
  • There's another "Rely on root motion?" option in the Player component - have you checked that as well?  If you instead disable root motion, does it then work?

    @carlosrovira: I am preparing a 2.5D tutorial that will also cover Mecanin-based players.
  • Thanks Chris, my game is 3D. This tutorial will be of use for 3D as well?
  • edited April 2015
    Thanks for the responses. Yes, I have tried all combinations for toggling component bools on the player character. I have root motion checked on for all, tried it other ways too. The only thing that does work, IS, if I uncheck the AC script called "Player.cs". I can then attach my own mecanim script, and the result that I have is movement that I want, but the Main Camera component seems to rely on the Player.cs script, so that I am not able to disable it. I tried to comment out lines on that script that had to do with IsGrounded but the scripts are too integrated.
    By the way, I have made some very successful mecanim controllers before, but because the player setup within adventure creator is a required component, I had to use the player.cs script attached to my character prefab. I went so far as to follow this tutorial to make sure I haven't overlooked anything:
    However, the same problem persists. I am not sure how trouble shooting works here most effectively, but I could try and provide screen shots of how everything is set up. Unless you have any other ideas of the problem, first? Recall that I am using direct control and pathfinding is set to Unity navigation. I'm sure there is a conflict with what I'm trying to do and what the script intends. I think I need to figure out of there is a work around.

    EDIT: I wanted to ask if you knew how to take a screen shot of the editor as it appears that PrtScreen doesn't work in Unity. I'm using a windows PC.
  • If you are working with Windows, use the "Snipping Tool" to make screenshots, it's integrated in Windows 7 and 8.
    Don't know about Mac.
  • I'm looking into some improvements for AC's Mecanim solution, but it's already possible to override the controller with your own.  Check out this tutorial, it should help.  The Player script is very important and necessary for more than just movement, but this tutorial will show you how to have both run at the same time.
  • Thanks for the response again. I didn't even know about that tutorial, so I had a read through. It does seem tailored for using that specific product from the Asset Store, Motion Controller, because I would have to change how CustomControllerLink interacts with my custom script. I'm not sure how successful I can be with that, and it feels like a longer solution than just being able to rely on AC mecanim in the same way I could rely on ACs legecy option. You did mention you are working on the functionality of using mecanim with AC, but for the mean time, I will try to adjust the script in the tutorial to work with my own code.
  • Update: I just wanted to let you know I think I fixed the problem. With my setup, instead of attaching a rigidbody, it turns out that using a character controller instead fixes the issue. It looks like a capsule collider can be attached too if needed for any other reason. In addition, I can also run a custom movement script on top of everything else. Now the only problem I am having is strange jerky camera movement. But I know of a few ways to fix that. Not too worried about that, as it's a lesser problem.
  • Good, glad it's solved.

    As for the tutorial - yes, it's geared towards a specific asset, but the point is to demonstrate the steps to link AC to any controller.  It's not possible to show the steps to link each and every controller out there, so the tutorial covers the principles involved in a general sense, using Motion Controller as an example.
  • Hi @kitsune_14, I have had the same problem and so did what you did here (thanks!) but now also have the same jerky movements, but they are just on the player, not the camera. I think it's something to do with the mecanim animation jerking around. Did you manage to fix the problem?

  • How is your player's root set up? Does he/she rely on a Rigidbody or Character Controller? Results are typically better with the latter, if you make use of Root Motion.

  • edited October 2019

    We are not using Root Motion. I have changed from rigidbody to character controller to fix the floaty gravity but now I have the jerky animation problem. So it doesn't matter which I use, as long as it works.

  • I can't tell if this is related to AC, or just your animation import settings. The floaty issue is typically resolved by tinkering with the Y Position settings in the animation import window.

    With the jerky animation, I'm assuming this occurs when the camera is stationary. It it the actual motion of the player's transform that's jerky, or the walking animation itelf? i.e. if you disable animation, does the jerkiness persist as he floats around.

  • Ok, after some tests, I have deduced that this only happens when the camera is moving and the character is moving. If I turn the animation off, it still happens.

    I am aware that this might not be an AC issue, but as it was possibly the same problem as Kitsune_14 had 4 years ago, I thought maybe they now knew the answer to the jerking.

  • Problem solved. I moved all the camera movement from Update to LateUpdate.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.