Hi there, i’m using UColorsBlueprintFunctionLibrary::GetScreenColorXY, compiling it without problem and adding
a 2d vector from blueprint to move the pixels coordinates to be able to read pixel colors. It will allways give me black pixel color as a result. (though alpha is allways 1)
Any idea? Is it a bug? I’m not able to find or to think about any reason for this.
Here i copy my code and a screenshot of my blueprint.
In my build.css:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ApplicationCore" });
In my .h:
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "ColorsBlueprintFunctionLibrary.generated.h"
UFUNCTION(BlueprintCallable, Category = "Colors")
static FLinearColor GetScreenColorXY(FVector2D InScreenPos, float InGamma);
In my cpp:
#include "GenericPlatformApplicationMisc.h"
FLinearColor UColorsBlueprintFunctionLibrary::GetScreenColorXY(FVector2D InScreenPos, float InGamma)
{
return FGenericPlatformApplicationMisc::GetScreenPixelColor(InScreenPos, InGamma);
And finaly in my blueprint i’m trying to use the function “Get Screen Color XY” in construction scritp
Debug on editor (in the picture i changed the name of the values, not a mistake there)