[4.5 Bug] Falling lateral friction problem

Same problem as you Unreal Engine 4.5 Released! - Announcements - Unreal Engine Forums

When upgrading my project to 4.5, I discovered a most frustrating problem: my character stops all horizontal movement when touching another object while in the air. For a platformer, it’s a bit disconcerting and potentially hazardous.

Through much testing, I narrowed the problem down to the falling lateral friction property in the character movement component. When the friction value is increased, the halting of horizontal movement is much more immediate when coming in contact with another object, but a friction value of 0 does not alleviate the problem. Is there perhaps some work around for this for the time being?

Further investigation has revealed that the problem actually lies with the air braking value, where colliding with an object causes the acceleration to be marked as zero, which then causes the braking deceleration to apply, bringing the character to a halt.

Even more bizarre is that changing line 2177 in CharacterMovementComponent.cpp to:

const bool bZeroAcceleration = false;

fixes the problem and doesn’t seem to impact the braking deceleration at all when not touching any objects, contrary to what one would expect.

hmm can be this a reliable fix? :slight_smile:

So far it’s working for me, but I’m afraid the solution itself was a bit hacky, since I was trying to bypass a portion of code to see what happened, and it worked better than I expected.

Hello Nefusadi,

I was unable to reproduce this issue on my end. If you could provide screen shots and/or any other information that I may be missing to help reproduce the problem you are running into it will get us closer to a possible solution. I am still a bit unclear as to the exact issue that is occurring.

So, whenever my character jumps and and is moving through the air (perhaps over a pit) and comes in contact with something, like a wall, all lateral movement stops, even if input is still being provided. Which means that although I’m telling my character to jump over the pit, he ends up falling in.

While testing, I changed the line 2177 in CharacterMovementComponent.cpp (the CalcVelocity() function) to: const bool bZeroAcceleration = false;

so that it bypassed the function call to ApplyVelocityBraking. As expected, this allowed me to now slide along the wall, instead of stopping. Unexpectedly, velocity braking continued to apply when I let up on the movement input, where I expected the character to continue to drift.

I double checked the character’s blueprint graph, and nothing on there influences this collision problem.

Illustration of movement

Character Movement Settings

Hello Nefusadi,

I was finally able to reproduce the issue in a clean project. I would suggest using the workaround as long as you continue to have no issues. I have submitted a report to the development team about the issue: JIRA report UE-4456. Thank you for the report.