Download

Get widget class by name

hi,

i’m a bit confuse, everything worked perfectly and suddenly my function send null everytime…



TSubclassOf<UUserWidget> UcppFunctionLibrary::getWidgetClassByName(FString path)
{
	UObject* ClassPackage = ANY_PACKAGE;
	UClass* Result;

	const TCHAR* p = *path;

	Result = FindObject<UClass>(ClassPackage, p);

	if (!Result)
	{
		UE_LOG(LogClass, Error, TEXT("No tree class at path: %s"), *path);
	}

	return Result;
}


a9eff0766ef8743750a8bb4d126d1c2c8ca57a06.png