Speeding up CharacterController.

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
zygmuntix
Posts: 8
Joined: Wed Mar 28, 2012 11:26 am

Speeding up CharacterController.

Post 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?
Fe_Yoshi
Posts: 397
Joined: Tue Jul 04, 2006 5:05 pm
Location: New Tower!

Re: Speeding up CharacterController.

Post by Fe_Yoshi »

Did you try attaching rocket boosters to it?
It's simple, just take the hydraulic phase ship emulator and attach it to the photon particle emitter, BAM, new tower!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Speeding up CharacterController.

Post 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.
zygmuntix
Posts: 8
Joined: Wed Mar 28, 2012 11:26 am

Re: Speeding up CharacterController.

Post by zygmuntix »

Thank you very much Norbo, you are very helpful :)
Post Reply