Description

The CharacterMovementComponent simulates the position of a jumping/falling character inside function UCharacterMovementComponent::PhysFalling() [CharacterMovementComponent.cpp:4381]. On the main code path, it integrates the velocity over the frame deltaTime using the trapezoid method (line 4494), which is simple and accurate method. It also tries to avoid missing the apex point with varying framerates by substepping around the zero vertical velocity point (line 4453).
However, when a blocking hit is detected on the movement (line 4524), the function seems to switch to the endpoint integration method (line 4534-4536). This results in a noticeably different jump apex height, which can be very detrimental to games with precise jumping requirements. Moreover, this method is highly framerate-dependent: the lower the framerate, the higher the integration timestep, which can result in a very low apex height, even with the current partial substepping strategy.

 

 

Steps to Reproduce
  • Open or create a new project based on the "3rd person" template.
  • Edit "BP_ThirdPersonCharacter":
  • Event "BeginPlay": Bind Event to On Reached Jump Apex
  • Event "OnReachedJumpApex": PrintString(GetActorLocation().z)
  • Event "OnMovementModeChanged": Set "Notify Apex" to "true"
  • PIE: Note the printed apex height in each situation:
  • Jump in place
  • Jump while moving towards a wall
  • Console "t.MaxFPS 30", then jump while moving towards a wall
  • Console "t.MaxFPS 10", then jump while moving towards a wall

The printed jump apex height will be lower in each case.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-218125 in the post.

0
Login to Vote

Unresolved
ComponentUE - Gameplay
Affects Versions5.4.25.15.25.3
Target Fix5.5
CreatedJun 17, 2024
UpdatedJul 26, 2024
View Jira Issue