CharacterController body speed, impulse and force
Posted: Tue Oct 28, 2014 9:07 am
Hi, I have a question about speed of the body under character controller and IsAffectedByGravity flag set to false.
I am using
to set moving direction for character controller body. And it is ok, but I need to change speed of this body and apply some impulses at some moments. And this causes some problems for me. I trying to change AirSpeed parameter, it works. But look's like it have some limitation, because after value 100 or something near it velocity of the body didn't increse even if I set value to 10000.
And then I trying to Apply impulse using :
loooks like nothing happend.
How I should change speed of body?
And how to apply impulse properly?
Maybe setting direction :
is droping down impulse direction vectors?
Thanks.
I am using
Code: Select all
Controller.HorizontalMotionConstraint.MovementDirection = new Vector2(SpeedVector.X, SpeedVector.Z);
And then I trying to Apply impulse using :
Code: Select all
Vector3 sp = new Vector3(0, 9000, 0);
cc.Body.ApplyLinearImpulse(ref sp);
How I should change speed of body?
And how to apply impulse properly?
Maybe setting direction :
Code: Select all
Controller.HorizontalMotionConstraint.MovementDirection = new Vector2(SpeedVector.X, SpeedVector.Z);
Thanks.