Hi, I’m really new to ue4 and I can’t get framerate independent rotation on my pawn. I’ve tested using the t.MaxFPS in the editor and the framerate is changing the sensitivity. Here’s the first attempt using the tick function.
void AMainCharacter::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
NewCameraRotation = GetActorRotation();
NewCameraRotation.Pitch += ( DeltaTime * AxisValue.Y * CamerRotationSpeed );
NewCameraRotation.Yaw += ( DeltaTime * AxisValue.X * CamerRotationSpeed );
SetActorRotation( NewCameraRotation );
}
void AMainCharacter::PlayerLookUp( float value )
{
AxisValue.Y = value;
}
void AMainCharacter::PlayerLookRight( float value )
{
AxisValue.X = value;
}
Here’s the second attempt using the controller.
void AMainCharacter::PlayerLookUp( float value )
{
AddControllerPitchInput( value * CamerRotationSpeed
* GetWorld()->GetDeltaSeconds() );
}
void AMainCharacter::PlayerLookRight( float value )
{
AddControllerYawInput( value * CamerRotationSpeed
* GetWorld()->GetDeltaSeconds() );
}
Isn’t deltatime used for things like this? Is there sth else I should read up on?