How to set UTexture2D to none in c++?

Hey!

How can I set a UTexture2D variable to null or none? I’m doing this in a struct.

Hi Ɛdmm

The best thing to do would be to store it as a pointer and set it to nullptr as you wouldn’t want to copy a texture anyway.

Thanks

Alex

As Alekann01 said in .h file :

UPROPERTY(EditAnywhere)
UTexture2D* MyTexture = nullptr;

Hope this works

Thanks for the answer! :slight_smile:

Thanks for the answer! :slight_smile: