How do I cast a TUniquePtr

Hi,

I wrote a custom SoundfieldEndpoint that is being called in:

void FCustomSoundfieldEndpoint::OnAudioCallback(TUniquePtr<ISoundfieldAudioPacket>&& InPacket, const ISoundfieldEndpointSettingsProxy* InSettings)

The InPacket should be of a FCustomSoundfieldPacket that I have encoded earlier and now I would like to cast

TUniquePtr<ISoundfieldAudioPacket>&& InPacket

to something like

TUniquePtr<FCustomSoundfieldPacket>

but I can’t seem to figure it out. It should be possible, doesn’t it?


If I do:

FCustomSoundfieldPacket* Packet = StaticCast<FCustomSoundfieldPacket*>(InPacket);

the packet does not contain the right information…

Turns out the cast would have worked but there was a different problem.
Also, there is a helper function called: DowncastSoundfieldRef<>();