- Home /
CharacterController movement messed up when Y Center is larger than radius
The CharacterController.Move function produces erratic results ( slipping/sliding jittering movement struggling to move in the correct direction ) when the y center is offset to more than the capsule radius. Unity 5.6.1f1
I'd supply an image but your image upload doesn't work ( Firefox 54.0.1 (32-bit) )
using UnityEngine;
namespace MyNamespace
{
public class TestController : MonoBehaviour
{
public CharacterController _controller;
public Animator _animator;
public Transform _transform;
Vector3 _deltaPosition = Vector3.zero;
void Start()
{
_deltaPosition = Vector3.zero;
}
void Update()
{
_animator.SetFloat( "Horizontal", Horizontal );
_animator.SetFloat( "Z", Horizontal );
_animator.SetFloat( "InputMagnitude", Mathf.Abs( Horizontal ) );
_animator.SetBool( "IsStopLU", true );
_controller.Move( _deltaPosition );
}
public float Horizontal
{
get{ return Input.GetAxis( "Horizontal" ); }
}
void OnAnimatorMove()
{
_deltaPosition = _animator.deltaPosition;
Debug.Log( "_deltaPosition " + _deltaPosition / Time.deltaTime );
}
}
}
Using Kubold's Sword animator controller and animations, no rigid body. The erratic movement increases in intensity relative to the amount the CharacterController capsule Y center's offset is over/larger than/above the CharacterController capsule's radius
Your answer
Follow this Question
Related Questions
why does character controller accelerate off ledges? 1 Answer
How to combine Quaternions? 1 Answer
Pushing a character controller (physics interaction) 0 Answers
Using .move(), the enemy moves faster at a diagonal 2 Answers
How can I get my character to move and strafe relative to the way its pointing? 2 Answers