CPP component is not visible in BP editor

Hello, Im new in UE, I’ve been scratching my head over this question.
I have no idea why class WeaponComponent is not visible in editor, no errors.
So sorry that I can’t describe issue better.
Any suggestions will be nice, thanks!

cpp file

header file

I think you need EditAnywhere macro added

here’s a useful resource:

1 Like

Thanks, no it didn’t work

Careful with this, usually VisibleAnywhere is preferred otherwise the blueprint editor can bug letting you modify things you shouldn’t be allowed to modify.I can’t find a clear example of some details I wrote in the past but I remember adding EditAnywhere to a property storing an ActorComponent on a Pawn and the editor panel would create conflicts with the c++ added component (CreateDefaultSubObject). There’s this issue as well (by design) where BP edits silently keep overriding c++ ones:

Bug, UPROPERTY removed from the editor panel still overriding c++ values

This could actually be happening right now (along with countless other things) but for this particular case where the c++ is alright but the blueprint fails you have to mark (or recreate) a misbehaving UPROPERTY and mark it Transient as discussed on that link.

2 Likes

You are missing the UCLASS macro above your component


UCLASS(ClassGroup = CommonLogic, editinlinenew, meta = (BlueprintSpawnableComponent))
class SHOOTTHEMUP_API USTUWeaponComponent : public UActorComponent {

}

Class Specifiers | Unreal Engine 4.27 Documentation

1 Like