Page 1 of 1
Speeding up CharacterController.
Posted: Tue Aug 28, 2012 10:08 am
by zygmuntix
Hi,
I have some problems with changing speed for CharacterController. I tried to change the line in CharacterController where the Camera position is changed:
Code: Select all
(CharacterController.StanceManager.CurrentStance == Stance.Standing ? StandingCameraOffset : CrouchingCameraOffset) * CharacterController.Body.OrientationMatrix.Up;
by multiplying it by some speed value, but it didn't work. Why is it like this? How can I increase the speed of CharacterController?
Re: Speeding up CharacterController.
Posted: Tue Aug 28, 2012 11:53 am
by Fe_Yoshi
Did you try attaching rocket boosters to it?
Re: Speeding up CharacterController.
Posted: Tue Aug 28, 2012 5:06 pm
by Norbo
That line of code offsets the camera vertically from the character body entity depending on whether or not it is crouched. Multiplying by the speed will simply increase or decrease the vertical offset, which is not what you want to do.
The speed of the character can be changed using the CharacterController.HorizontalMotionConstraint.Speed. There's also a CrouchingSpeed, AirSpeed, and SlidingSpeed. The CrouchingSpeed is how fast the character can accelerate itself to under its own power when crouching. The AirSpeed is how fast the character can accelerate itself to under its own power while not supported by anything. The SlidingSpeed is how fast the character can accelerate itself to under its own power while it has support, but not traction. There are also corresponding MaximumForce (covering both standing and crouching), MaximumAirForce, and MaximumSlidingForce properties which govern how fast the character accelerates under different conditions.
Did you try attaching rocket boosters to it?
This would also work.
Re: Speeding up CharacterController.
Posted: Wed Sep 05, 2012 10:12 am
by zygmuntix
Thank you very much Norbo, you are very helpful
