So, I’ve go this function that selects and retrieves an icon for a horizontal scrolling compass:
UFUNCTION(BlueprintCallable, Category = "TrackTarget")
UTexture2D* GetTrackTargetTexture();
But now I want it to use two icons, one main icon that fades out the farther you are from the target, and an outline icon that doesn’t fade. So I’d like to create a function with two output variables.
If I define it like this:
UFUNCTION(BlueprintCallable, Category = "TrackTarget")
void GetTrackTargetTextures(UTexture2D &OutFrontTexture, UTexture2D &OutBackTexture);
Visual studio gives me the error: Found ‘&’ when expecting ‘*’
But if I define it like this:
UFUNCTION(BlueprintCallable, Category = "TrackTarget")
void GetTrackTargetTextures(UTexture2D *FrontTexture, UTexture2D *BackTexture);
In blueprints, they only show up as input parameters.
I could split it into two separate functions, but I’d like to know if it’s possible to get this working as single function that outputs two UTexture2Ds.
The icons are stored on the same object, like so:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Icons")
TObjectPtr<UTexture2D> EnemyBossIcon;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Icons")
TObjectPtr<UTexture2D> EnemyBossOutlineIcon;