# Component loses values

**URL:** <https://forums.unrealengine.com/t/component-loses-values/447361>\
**Category:** Community & Industry Discussion\
**Tags:** customization, unreal-engine, component, Scripting, Components, question\
**Created:** [April 16, 2019, 7:39pm UTC](https://forums.unrealengine.com/t/component-loses-values/447361 "2019-04-16T19:39:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dlitte\_Wacken](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dlitte\_Wacken](https://forums.unrealengine.com/u/Dlitte_Wacken)\
**Post date:** [April 16, 2019, 7:39pm UTC](https://forums.unrealengine.com/t/component-loses-values/447361/1 "2019-04-16T19:39:51Z")

</div>

I have a component derived from Point Light Component. Also, there is one property that I added. I can put it into blueprint as a component and this object in the scene works fine.  
Point is that when I change any component value in the blueprint asset and restart editor or recompile the project all properties reset.

Here is my .h component code:

```
#include "CoreMinimal.h"
#include "Components/PointLightComponent.h"
#include "MyActorComponent.generated.h"

UCLASS(Blueprintable, ClassGroup = Lights, hidecategories = Object, editinlinenew, meta = (BlueprintSpawnableComponent))
class COOLSHOOTER_API UMyActorComponent : public UPointLightComponent
{
	GENERATED_BODY()

public:	
	// Sets default values for this component's properties
	UMyActorComponent();

	UPROPERTY(EditAnywhere, Blueprintable)
		int integer;

protected:
	// Called when the game starts
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

		
};

```

There is nothing in ccp, so I don’t post it.

As a result, I want to be able to set default values for a component inside blueprint;

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [April 16, 2019, 7:51pm UTC](https://forums.unrealengine.com/t/component-loses-values/447361/2 "2019-04-16T19:51:05Z")

</div>

Did you try to recreate the component,  
I had a similar problem and the only thing that fixed it was  
deleting the component  
adding it again  
save.

---

<div class="post-metadata">

**Author:** ![Dlitte\_Wacken](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dlitte\_Wacken](https://forums.unrealengine.com/u/Dlitte_Wacken)\
**Post date:** [April 16, 2019, 8:23pm UTC](https://forums.unrealengine.com/t/component-loses-values/447361/3 "2019-04-16T20:23:03Z")

</div>

I didn’t, but it happens with any component I create. I tried to create 4 different components in 3 different projects.
