# Can't edit CollisionBox created via C++ in Blueprint Viewport

**URL:** <https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625>\
**Category:** C++\
**Tags:** unreal-engine, Blueprint, CPP, question\
**Created:** [December 9, 2022, 8:48am UTC](https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625 "2022-12-09T08:48:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rbey](https://forums.unrealengine.com/u/rbey)\
**Post date:** [December 9, 2022, 8:48am UTC](https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625/1 "2022-12-09T08:48:21Z")

</div>

Hi,

I want to create a CollisionBox for my weapon so I added a UPROPERTY with UBoxComponent\* and initialized it in the constructor using CreateDefaultSubobject. The component is created correctly but I can’t edit it in the viewport of the blueprint, I want to move the box and resize it to take only the blade of my axe. But the details pane is completly empty.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/9/689be79a1fc0cd48b65b031e48055883488e03c0.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/5/fa5617be2e8c09245d65525d63fad082dfc120ff.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/c/85cfbed4c90c8e7887353d9f0c58f6355309115f.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/0/7/707c13168d196a200c4f5e784a45154be51a042c.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/d/38df66991cbe48d96ece6e0d45718fda5c674c99.jpeg)

Thank you for your time,

---

<div class="post-metadata">

**Author:** ![rbey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rbey](https://forums.unrealengine.com/u/rbey)\
**Post date:** [December 9, 2022, 10:11am UTC](https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625/2 "2022-12-09T10:11:56Z")

</div>

So I managed to get it work, but it’s strange, what I did was remove everything related to the box from .h file and .cpp, close editor build everything, run editor again to check everything, then create the property on .h and the code in constructor in .cpp, close editor again, build and then restart the editor, and now it’s working.

---

<div class="post-metadata">

**Author:** ![Sartox1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sartox1/32/630006_2.png) [@Sartox1](https://forums.unrealengine.com/u/Sartox1)\
**Post date:** [March 8, 2023, 11:57am UTC](https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625/3 "2023-03-08T11:57:53Z")

</div>

If anyone stumbles upon this thread and the proposed solution from rbey does not work, take a look at this thread too

> [@\[Solved\]Blank detail panel for UStaticMeshComopnent in child blueprint class of a C++ class](https://forums.unrealengine.com/t/solved-blank-detail-panel-for-ustaticmeshcomopnent-in-child-blueprint-class-of-a-c-class/141378):
>
> This issue has be solved by re-create related blueprints. [HR][/HR] Hey guys, I’ve met a issue that I can’t solve it out. That thing is, I created a custom class inherited from ACharacter, and inserted the following code in order to add a simple static mesh component to it: .h UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Mesh, meta = (AllowPrivateAccess = "true")) class UStaticMeshComponent\* SMWeapon; .cpp SMWeapon = CreateDefaultSubobject\<UStaticMeshComponent\>(TEXT("SM…

---

<div class="post-metadata">

**Author:** ![MilionX](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/milionx/32/1194703_2.png) [@MilionX](https://forums.unrealengine.com/u/MilionX)\
**Post date:** [October 18, 2023, 7:28am UTC](https://forums.unrealengine.com/t/cant-edit-collisionbox-created-via-c-in-blueprint-viewport/724625/4 "2023-10-18T07:28:40Z")

</div>

yeah. no magic.  
only need to restart.
