I have a move function in my Character where I move my charachter. In this move function I do the following calculation:
DeltaTime * (Input * SpeedMulitplier).
FVector2D CurrentSpeed = { (float)FApp::GetDeltaTime() * (m_MoveDirection.X * m_SpeedModifier), (float)FApp::GetDeltaTime() * (m_MoveDirection.Y * m_SpeedModifier)};
The calculation is correct because of the following example:
If I should move 10 units per frame on 60 FPS
It now moves 20 units per frame on 30 FPS.
When I try it out and change my frame rate from 60 to 30 while playing the game the player moves faster instead of moving at the same pace.
Does someone know a solution to keep the character moving on the same pace?
URL to GIF where problem is visible: Screen capture - 816383b819a9a12552f021729a802fc0 - Gyazo
My whole move function:
void AGamePlayer::Move()
{
FVector2D CurrentSpeed = { (float)FApp::GetDeltaTime() * (m_MoveDirection.X * m_SpeedModifier), (float)FApp::GetDeltaTime() * (m_MoveDirection.Y * m_SpeedModifier)};
AddMovementInput(GetActorForwardVector(), CurrentSpeed.Y);
AddMovementInput(GetActorRightVector(), CurrentSpeed.X);
}