Why does Character Movement override Add Force?
Hello, I am working on a game which has a water current element to it. I want the flow of the water to move the character realistically (i.e. push them in one direction, if they swim in the opposite direction, then the flow should make them move slower etc.).
The max swim speed for the character is set to 1,000.0. So if the flow speed of the water is 500.0, I would like the character to swim at 1500 downstream and 500 upstream. But this does not seem to be working.
I have tried several different ways to accomplish this, but the closest that I have come so far is by using the AddForce() method from the UCharacterMovementComponent (I found that adding a float value of 5,000.0 gives me the best effect) . This seems to work fine, if the character is simply riding the flow - he will keep accelerating all the way up to about 1,900.0. However, if I move the character, then the Movement component seems to override the force and he suddenly brakes down to 1,000.0. Also, the character is able to swim upstream at 1,000.0.
Am I doing something wrong by using AddForce to this end? Or would it be best to create a new movement class and override some of the methods?
Any suggestions would be appreciated.
Thanks in advance
asked Apr 19 '15 at 04:13 AM in C++ Programming
PhysX Kinematic vs Simulating
"Am I doing something wrong by using AddForce to this end?"
Characters are Kinematic , regular physics objects are "simulating"
Simulating actors respond to add force and add impulse
Kinematic actors ignore both :)
Use CharacterMovement->Velocity += your impulse to push characters the way you want to
My C++ Code For You
YourCharacter->GetCharacterMovement()->Velocity += Force;
Follow this question
Once you sign in you will be able to subscribe for any updates here