Multiplication by DeltaTime

Hi. I understand the need to multiply by Delta Time in the LookUpRate() and LookRightRate() functions, but what I don’t understand is why we don’t need to do that in the MoveForward() and MoveRight() functions as well.

For reference, this question is supposed to belong to the lecture “Controller Aiming” on Unreal 5.0 C++ Developer: Learn C++ and Make Video Games (tag 4_SS_EC5).

Thanks.

1 Like

That’s just how those functions are designed. AddMovementInput doesn’t actually do the moving, it just adds to the velocity. As noted in the docs

Add movement input along the given world direction vector (usually normalized) scaled by ‘ScaleValue’. If ScaleValue < 0, movement will be in the opposite direction. Base Pawn classes won’t automatically apply movement, it’s up to the user to do so in a Tick event. Subclasses such as Character and DefaultPawn automatically handle this input and move.

So derived classes like Character should handle that themselves. Where as with AddControllerPitchInput you need to.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms