Hi all,
Apologies for what may appear to be a fairly obvious problem!
I have a custom “ability” type. The header appears like this:
UCLASS(Blueprintable)
class ROGUELIKE_API UAbility : public UObject
{
GENERATED_UCLASS_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
UAbilityInfo* Info;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
AAbilityBehaviourActor* Behaviour;
};
The info object looks like this:
UCLASS(Blueprintable)
class ROGUELIKE_API UAbilityInfo : public UObject
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
FString Description;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
TEnumAsByte<AbilityTypeEnum> AbilityType;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
float ResourceCost;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
float CastTime;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Abilities")
float Cooldown;
};
Along with various other properties.
I had begun originally creating these abilities in C++ by instantiating these classes. What I want to achieve also, is the ability to create blueprints derived from these classes, and load them at runtime for use.
In aid of this, I have created a blueprint that has a parent of “UAbility”. I have also created a blueprint that is a child of UAbilityInfo, and contains all of the info for this new ability.
I would have rather have been able to set the info properties from the Ability object in blueprint, but that doesn’t matter for functionality purposes.
When I open the blueprint that derives from ability, I can see the Info property in the defaults pane. However, frustratingly, I cannot actually set that value to anything, including the AbilityInfo derived blueprint:
Where am I going wrong?
My hopeful end state is to be able to create these abilities by making a blueprint for each one, and setting the variables such as the Info before runtime.
Another, smaller matter is that the “ReceiveBeginPlay” event is never called on this custom UAbility blueprint. Is there somewhere to toggle that?