# FPropertyChangedEvent - Mesh disappears, when editing value in Editor

**URL:** <https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877>\
**Category:** Asset Creation\
**Tags:** unreal-engine, bug-report, editor, CPP, question\
**Created:** [May 27, 2015, 10:29am UTC](https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877 "2015-05-27T10:29:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ukmasmu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ukmasmu](https://forums.unrealengine.com/u/Ukmasmu)\
**Post date:** [May 27, 2015, 10:29am UTC](https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877/1 "2015-05-27T10:29:34Z")

</div>

Hello everyone,

I tried to create my own c++ Item class, by extending the AActor class, that has some specific behaviour, when I change a property in the editor. I implemented the FPropertyChangedEvent and everything worked out well, but each time I changed the value of a boolean - I only had boolean variables - the StaticMesh that was also attached to the Item disappeared in editor. (Later I tested it with other variables like int32 and it also happened.)

On play the mesh is visible, but in the Editor it only gets visible again after relaunching the engine.

 ![44247-pre+&+post+click.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/c/c9ccc471d6f728cebc4fe1bd3c6e4e9642956a84.png)

(On A everything worked normally and after clicking on the boolean the Mesh disappeared as seen in B)

I reproduced the error on a simple example like this:

MyActor.h

```
UCLASS()
class EDIORCHANGETRY_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor(const FObjectInitializer& ObjectInitializer);

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called after variable was changed in Editor.
	virtual void PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) override;
	
	//Boolean Test variable
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "General")
		bool boolean;

	//Mesh attached to the root of the component
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mesh")
		UStaticMeshComponent* Mesh;

	//Arrowcomponent just as root component of the Object.
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Mesh")
		UArrowComponent* Arrow;
};

```

MyActor.cpp

```
// Sets default values
AMyActor::AMyActor(const FObjectInitializer& ObjectInitializer)
{
 	// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	
	//Set default value of boolean.
	boolean = false;

	//Set default subobject of Mesh.
	Mesh = ObjectInitializer.CreateDefaultSubobject < UStaticMeshComponent > (this, TEXT("Mesh"));

	//Set default subobject of Arrow.
	Arrow = ObjectInitializer.CreateDefaultSubobject<UArrowComponent>(this, TEXT("Arrow"));

	//Set arrow as root.
	RootComponent = Arrow;

	//Attach mesh to root component.
	Mesh->AttachTo(RootComponent);
}

// Called when the game starts or when spawned. Default.
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
}

// Called every frame. Default.
void AMyActor::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );
}

// Called after variable was changed in Editor.
void AMyActor::PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent)
{
	//There isn't even code in here.
}

```

Am I missing something here or is this a bug?

Greetings,  
Ukmasmu

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [May 27, 2015, 12:48pm UTC](https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877/2 "2015-05-27T12:48:54Z")

</div>

Hi Ukmasmu,

When you override a function from the parent class, as you are doing in this situation with PostEditChangeProperty, you have to include a Super to call the original function that you’re overriding. You would need to add this to the body of the function:

Super::PostEditChangeProperty(PropertyChangedEvent);

After doing this and compiling, changing things in the editor will no longer make them disappear, but it will allow them to update on the fly.

Have a nice day,

---

<div class="post-metadata">

**Author:** ![Ukmasmu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ukmasmu](https://forums.unrealengine.com/u/Ukmasmu)\
**Post date:** [May 27, 2015, 1:03pm UTC](https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877/3 "2015-05-27T13:03:53Z")

</div>

Yeah, that was it. 😃

Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [May 27, 2015, 1:11pm UTC](https://forums.unrealengine.com/t/fpropertychangedevent-mesh-disappears-when-editing-value-in-editor/319877/4 "2015-05-27T13:11:30Z")

</div>

Glad to hear it. Let us know if you need any more assistance.
