My code:
APlayerController* controller = UGameplayStatics::GetPlayerController(this->GetWorld(), 0);
FRotator Rotation = Controller->GetControlRotation();
Controller->SetControlRotation(Rotation.Pitch + amount*5, Rotation.Yaw, Rotation.Roll);
The error I get:
error C2660, function doesnt accept 3 arguments
What is the reason for that ?
>Solution :
SetControlRotation requires 1 argument of type FRotator, not 3 separate ones for the rotation components (pitch, yaw, roll).
This is the meaning of the error you get (error C2660, function doesnt accept 3 arguments).
You can fix it by constructing a FRotator object from the 3 components, like this:
Controller->SetControlRotation(
//--------------------vvvvvvvv--------------------------
FRotator(Rotation.Pitch + amount*5,
Rotation.Yaw,
Rotation.Roll));
Note that although FRotator is composed of the 3 components, it is not the same (from the C++ point of view) as the 3 components given separatly.