Assign Blueprint Class as a property

You can’t set a blueprint instance from within the blueprint, only from within a level (it needs the instance of that object to exist, because it is a pointer).

You can on the other hand use

UPROPERTY(EditAnywhere,BlueprintReadWrite)
	TSubclassOf<ABaseMeleeWeapon> MeleeWeapon;

This will be a UClass of the object, with the filter of ABaseMeleeWeapon so it will encompass any class that also derives from it.

You can then use the class to spawn an actor from it.

Otherwise you need to populate it with an instance that is already in the world with for instance get actor of class or direct in level setting.

1 Like