- Home /
Mecanim Issue
So I downloaded the blacksmith characters and I am using the challenger as my third person character. I scaled him to 10 so he would fit my environment. Then I added an animator component and called it: WallaceAnimation (I thought Wallace would be a good name for now), and applied root motion.
Here is what my animation tree looks like:
By default he will be idle which is what it should be obviously.
Locomotion is a blend tree and this is what it looks like inside:
The inspector says this:
Blend type : 1D
Parameter (to us as default): Direction
Motion:
RunLeft: Threshold @ -1, (and the next box, which I don't know what to call it) @ 0.9933442
Run (Run forwards): Threshhold @ 0, @1.013583
RunRight: Threshold @ 1, @ 0.9933442
Automate threshold checkbox in unchecked Compute threshold is default Adjust time scale: Homogeneous speed
The two parameters being used is speed initialized at 0.0 and the same goes for direction. Both are floats.
The model has a rigidbody, mass of 60 and xyz rotation frozen.
It has a capsule collider: IsTrigger = uncheckd No material center is -0.05,1,0 Radius is 0.3 Height is 2
(This is because the gameobject the model is store in is a bit weird position. A little offcentered. Didn't want to mess with it thought yet)
and it has this script
using UnityEngine;
using System.Collections;
public class CharacterControllerLogic : MonoBehaviour
{
#region Private Variables
[SerializeField]
private Animator animator;
[SerializeField]
private float DirectionDampTime = 0.25f;
private float speed = 0.0f;
private float h = 0.0f;
private float v = 0.0f;
#endregion
// Use this for initialization
void Start ()
{
animator = GetComponent<Animator>();
if (animator.layerCount >= 2)
{
animator.SetLayerWeight(1, 1);
}
}
// Update is called once per frame
void Update ()
{
if(animator)
{
h = Input.GetAxis("Horizontal");
v = Input.GetAxis("Vertical");
speed = new Vector2(h,v).sqrMagnitude;
animator.SetFloat("Speed", speed);
animator.SetFloat("Direction", h, DirectionDampTime, Time.deltaTime);
}
}
}
However there is a problem. Whenever I climb up my terrain, my character starts floating a bit but then gravity takes it down. Is it because of the code, animation, capsule collider, or rigidbody mass? Idk what it is. (It might be helpful to do the exact same thing I have to check what is going on, like download the asset and do similar animations and code.
Your answer
Follow this Question
Related Questions
Animation not blending properly 1 Answer
How to delete Mecanim files? 0 Answers
Mecanim Floating Feet 0 Answers
Mecanim random Bugs 1 Answer