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.
Comments
@carlosrovira: I am preparing a 2.5D tutorial that will also cover Mecanin-based players.
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:
http://www.adventurecreator.org/tutorials/making-mecanim-based-character
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.
Don't know about Mac.
Cheers,
Orrence.
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.
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.