[Question] FRotator doubt

In ShooterCharacter.cpp i added the below code but it wont compile because of an error.

FRotator AShooterCharacter::GetCharacterViewRotation(FName ESocket) const
	FVector ViewLoc;
	FRotator ViewRot;
	if ((ESocket == NULL ))
		return GetViewRotation();

	Mesh->GetSocketWorldLocationAndRotation(ESocket, ViewLoc, ViewRot);

	return ViewRot;

Error: ‘USceneComponent::GetSocketWorldLocationAndRotation’ : cannot convert parameter 3 from ‘FRotator’ to ‘FRotator *’

You need to put an & in front of ViewRot, because that function takes a pointer to a rotator. That is actually a bit confusing, I’m going to change the function now to take a ref just like OutLocation. Thank you for pointing it out!

Thanks James :slight_smile: