I am trying to set the transform values for an Actor using C++. Here is the code:
double rand_posX = 10;
double rand_posY = 10;
double rand_posZ = 10;
double rand_pitch = 45;
double rand_yaw = 45;
double rand_roll = 45;
FTransform ReturnTransform;
ReturnTransform.SetLocation(FVector(rand_posX, rand_posY, rand_posZ));
ReturnTransform.SetRotation(FRotator(rand_pitch, rand_yaw, rand_roll));
return ReturnTransform;
I get an error at the FRotator line which says: no suitable user-defined conversion from “FRotator” to “const UE::Math::TQuat” exists
Please help me fix this error and if there is a more elegant way to set the transform of my actor, I would appreciate it. Thank you!