So I have the code below and Im using 4.6.1, and when I go into blueprints and try to break the struct it doesnt seem to show up. I used one of Rama’s many tutorials, which can be found here:A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums
to setup the structs, but they still arent functioning the way I would like them to. Now I realize Rama’s post was done before 4.6 and I was wondering if anything changed to how structs need to be declared for them to work properly in blueprints.
any thoughts or tips would be appreciated on this one.
USTRUCT()
struct FInstantWeaponData
{
GENERATED_USTRUCT_BODY()
/** base weapon spread (degrees) */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float WeaponSpread;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float BonusAccuracy;
/** continuous firing: max increment */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float FiringSpreadMax;
/** weapon range */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float WeaponRange;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float MinWeaponRange;
/** damage amount */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
int32 HitDamage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
int32 BonusDamage;
//number of attacks per second
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float AttackRate;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
float ReloadSpeed;
/** type of damage */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "WeaponData")
TSubclassOf<UDamageType> DamageType;
/** defaults */
FInstantWeaponData()
{
WeaponSpread = 5.0f;
BonusAccuracy = 0;
FiringSpreadMax = 10.0f;
MinWeaponRange = 400;
WeaponRange = 10000.0f;
HitDamage = 2;
BonusDamage = 0;
AttackRate = 1;
ReloadSpeed = 1;
DamageType = UDamageType::StaticClass();
}
};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
FInstantWeaponData InstantConfig;