I have buncha blueprint weapons derived from C++ base class and am trying to equip my enemy character with a weapon.
in header:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Guns, meta=(AllowPrivateAccess = "true"))
class AMyWeaponBase* EnemyWeapon;
in constructor:
// Equip Weapon
const USkeletalMeshSocket* WeaponSocket = GetMesh()->GetSocketByName("WeaponSocket");
if (WeaponSocket && EnemyWeapon)
{
EnemyWeapon->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "WeaponSocket");
}
When I try to set a weapon in my enemy character BP, my weapon blueprints doesn’t show up in dropdown, they only show up if I drag them into the level but even then selecting them doesn’t work/do anything. What am I doing wrong?