# Component class override - buggy?

**URL:** <https://forums.unrealengine.com/t/component-class-override-buggy/350952>\
**Category:** Community & Industry Discussion\
**Tags:** override, Class, unreal-engine, component, editor, question\
**Created:** [March 18, 2016, 11:02am UTC](https://forums.unrealengine.com/t/component-class-override-buggy/350952 "2016-03-18T11:02:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_111fd632](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_111fd632](https://forums.unrealengine.com/u/anonymous_user_111fd632)\
**Post date:** [March 18, 2016, 11:02am UTC](https://forums.unrealengine.com/t/component-class-override-buggy/350952/1 "2016-03-18T11:02:55Z")

</div>

Hello,

I’m trying to overwrite the class of a component. The component is defined in C++ like this:

```
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Rendering")
class UStaticMeshComponent* StaticMesh;

```

In the editor, I get a box showing me which classes I can select as replacement (see screenshot).

Now, no matter what class I select from that list, once I compile the blueprint, if I view the StaticMesh-component again it shows the selected class to be “None”. It will now also fail to spawn the Blueprint properly. Saving the selection will also not work, no matter if I save before compiling or after it, it will be “None” while running, and after a restart of the Engine it will have selected the default class (“Static Mesh”).

This happens for all component-classes I tested it with. I have a custom component where I actually need it, but I thought using mesh as an example is easier to reproduce.

Now, is there anything I have to do to make this work? Or is there a bug regarding this in the current version of the engine?

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [June 16, 2023, 10:01pm UTC](https://forums.unrealengine.com/t/component-class-override-buggy/350952/2 "2023-06-16T22:01:42Z")

</div>

You must to create your own class in C++ drived from UStaticMeshComponent
