Returning an object

How would I make it so that I can return both “PlayerViewPointLocation” and “PlayerViewPointRotation”

basically, like an object, for example in JS it’d be:

{
location: {},
rotation: {}
}

and how would I then use that object in unreal c++?

thanks!

I don’t believe there’s already a type for FVector + FRotator (FTransform has 2 FVectors), so you’d need to create that and then use that for the return type e.g.

struct FLocAndRot
{
    FVector Location;
    FRotator Rotation;
};

FLocAndRot Foo()
{
    FVector L;
    FRotator R;
    return { L, R }; // order matters
}

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms