Using FFRotationMatrix with Set ActorLocationRotation,.

Hello, Ue Community I recently started learning C++ to convert some BP to it.

but now I hit an issue and I’m kinda stuck, I’m trying to use FRotationMatrix::MakeFromZX but getting some issues.
I’m using an ActorComponent for this.

hope someone can help me.

   AActor* Parent = GetOwner();

 FMatrix AlignRotation = FRotationMatrix::MakeFromZX(Parent->GetActorLocation(), Parent->GetActorForwardVector());

Parent->SetActorLocationAndRotation(Parent->GetActorLocation() + Parent->GetActorForwardVector() * MoveingSpeed * DeltaTime, FMatrix (AlignRotation), false, 0, ETeleportType::None);

Getting an issue here at "->" saying
Error (active)    E0304    no instance of overloaded function "AActor::SetActorLocationAndRotation" matches the argument list.


The 2nd parameter in SetActorLocationAndRotation is supposed to be an FRotator, luckily you can convert from FMatrix to FRotator very easily.

No way dude that easy lol, thanks a lot man! :smiley: