[SOLVED]CharacterController XBOX Acceleration
Posted: Sat Jan 14, 2012 12:37 pm
I would like the character to slowly accelerate. If I move the thumbstick a little I want the character to move a little. Currently the character will move from standing still to maximum speed almost instantly.
In CharacterControllerInput, is this just determining the direction of movement?
I tried changing the code to this:
However, this did not alter the characters acceleration. Presumably because its just a direction? Also with this change the character could only move right or forward, not left or back, which confused me.
Should I be passing the thumbstick values to HorizontalMotionConstraint and use them to modify MaxSpeed?
I have played with increasing the characters mass. A mass of 30 gives an acceptable smooth stop rather than an abrupt halt. A mass of 300 is more akin to a hovercraft.
Ideally I would like some dampening so that i can accurately move the character small amounts. Also I would like left, right and back speeds to be a lot less than forward speeds.
Any help would be great!
Thank you.
In CharacterControllerInput, is this just determining the direction of movement?
Code: Select all
#if XBOX360
Vector3 forward = Camera.WorldMatrix.Forward;
forward.Y = 0;
forward.Normalize();
Vector3 right = Camera.WorldMatrix.Right;
totalMovement += gamePadInput.ThumbSticks.Left.Y * new Vector2(forward.X, forward.Z);
totalMovement += gamePadInput.ThumbSticks.Left.X * new Vector2(right.X, right.Z);
CharacterController.HorizontalMotionConstraint.MovementDirection = Vector2.Normalize(totalMovement);
Code: Select all
#if XBOX360
Vector3 forward = Camera.WorldMatrix.Forward;
forward.Y = 0;
forward.Normalize();
Vector3 right = Camera.WorldMatrix.Right;
totalMovement += gamePadInput.ThumbSticks.Left.Y * gamePadInput.ThumbSticks.Left.Y * new Vector2(forward.X, forward.Z);
totalMovement += gamePadInput.ThumbSticks.Left.X * gamePadInput.ThumbSticks.Left.X * new Vector2(right.X, right.Z);
CharacterController.HorizontalMotionConstraint.MovementDirection = Vector2.Normalize(totalMovement);
Should I be passing the thumbstick values to HorizontalMotionConstraint and use them to modify MaxSpeed?
I have played with increasing the characters mass. A mass of 30 gives an acceptable smooth stop rather than an abrupt halt. A mass of 300 is more akin to a hovercraft.
Ideally I would like some dampening so that i can accurately move the character small amounts. Also I would like left, right and back speeds to be a lot less than forward speeds.
Any help would be great!
Thank you.