# Problem with component

**URL:** <https://forums.unrealengine.com/t/problem-with-component/631239>\
**Category:** C++\
**Tags:** unreal-engine, Components, UE4-27, CPP, question\
**Created:** [August 18, 2022, 5:24pm UTC](https://forums.unrealengine.com/t/problem-with-component/631239 "2022-08-18T17:24:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nomlsbad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nomlsbad](https://forums.unrealengine.com/u/Nomlsbad)\
**Post date:** [August 18, 2022, 5:24pm UTC](https://forums.unrealengine.com/t/problem-with-component/631239/1 "2022-08-18T17:24:21Z")

</div>

Hi. I created HealthComponent in the class constructor of my character.After that I checked it and everything was allright . However when I used the IsValid function in BeginPlay,it returned me false. I don’t understand why this is happening. What is the problem please tell me

There are character and component files:  
[STUHealthComponent.h](https://forums.unrealengine.com/uploads/short-url/f3ucqhVDBuDAtlncHP1pV1nzMr0.h) (1.5 KB)  
[STUBaseCharacter.h](https://forums.unrealengine.com/uploads/short-url/cts5GXHE1RYQqnBzkr4qSFdRJoY.h) (2.0 KB)  
[STUHealthComponent.cpp](https://forums.unrealengine.com/uploads/short-url/vUm16L9cO3E48ZJJva1Z3TT2vr6.cpp) (1.1 KB)  
[STUBaseCharacter.cpp](https://forums.unrealengine.com/uploads/short-url/5crtgtmJGsYFpuFE8PrJOmpP6Ms.cpp) (4.2 KB)

And link to the git with the whole project:

> **[GitHub - Nomlsbad/ShootThemUp](https://github.com/Nomlsbad/ShootThemUp)**
>
> Contribute to Nomlsbad/ShootThemUp development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![zeaf](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zeaf/32/1108035_2.png) [@zeaf](https://forums.unrealengine.com/u/zeaf)\
**Post date:** [August 18, 2022, 9:03pm UTC](https://forums.unrealengine.com/t/problem-with-component/631239/2 "2022-08-18T21:03:20Z")

</div>

I downloaded your project and it seems like your character BP has been slightly corrupted. You can fix it by reparenting the BP to Character, save the BP, and then reparent back to STUBaseCharacter, the health component seems to work after that

That will most likely result in a loss of all modified parameters in any of the components though, so be ready for that
