I’m trying to expose a UObject variable into an AActor, but in the final steps I can’t finish.
My walkthrough was the next:
I created a UObject class in C++
- Added a UBoject class within Blueprintable parameter into CLASS macro
- Exposed inside variables with UPROPERTY macro
UCLASS(Blueprintable)
class SLIMEWAR_API UWeaponBase : public UObject
{
GENERATED_BODY()
private:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "BaseWeapon", meta=(AllowPrivateAccess="true"))
float RateShoot;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "BaseWeapon", meta = (AllowPrivateAccess = "true"))
float RateShootAmmount;
...
};
- I created an AActor class that references the UObject:
UCLASS()
class SLIMEWAR_API AGiverTrigger : public AActor
{
GENERATED_BODY()
private:
...
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Giver", meta = (AllowPrivateAccess = "true"))
UWeaponBase* Holi2;
...
};
- I created a Blueprint class derived from UObject
- Reference the previously Actor into World, and when I try to link my Blueprint from Content to variable field of Actor, UE can’t do:
I want create a UObject class to allow the designer can create weapons creating Blueprints that inherits from UWeapon, what can I do?
Thanks!