# CPP component is not visible in BP editor

**URL:** <https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, editor, CPP, question\
**Created:** [May 16, 2023, 1:03am UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047 "2023-05-16T01:03:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsunami080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tsunami080](https://forums.unrealengine.com/u/Tsunami080)\
**Post date:** [May 16, 2023, 1:03am UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047/1 "2023-05-16T01:03:19Z")

</div>

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!

 ![Screenshot_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/7/307a82b5a52d73ad94c947496329d0e1b8549396.jpeg)

**cpp file**

> **[WeaponComponent.cpp - Pastebin.com](https://pastebin.com/94TVyEd6)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

**header file**

> **[WeaponComponent.h - Pastebin.com](https://pastebin.com/9uvRKgxp)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [May 16, 2023, 1:30am UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047/2 "2023-05-16T01:30:24Z")

</div>

I think you need EditAnywhere macro added

here’s a useful resource:

> **[All UPROPERTY Specifiers](https://benui.ca/unreal/uproperty/)**
>
> Both main and meta specifiers, including undocumented ones.

---

<div class="post-metadata">

**Author:** ![Tsunami080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tsunami080](https://forums.unrealengine.com/u/Tsunami080)\
**Post date:** [May 16, 2023, 11:04am UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047/3 "2023-05-16T11:04:35Z")

</div>

Thanks, no it didn’t work

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 16, 2023, 11:24pm UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047/5 "2023-05-16T23:24:45Z")

</div>

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](https://forums.unrealengine.com/t/bug-uproperty-removed-from-the-editor-panel-still-overriding-c-values/521017)

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.

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [May 16, 2023, 11:38pm UTC](https://forums.unrealengine.com/t/cpp-component-is-not-visible-in-bp-editor/1167047/6 "2023-05-16T23:38:28Z")

</div>

You are missing the UCLASS macro above your component

```auto

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

}

```

> [Class Specifiers | Unreal Engine 4.27 Documentation](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/GameplayArchitecture/Classes/Specifiers/)
