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