PostEditChangeProperty() is not a member of UActorComponent?

I have a plugin, which contains a component, which inherits from UActorComponent. Below is a small snippet of the code:

MyComponent.h

#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "MyComponent.Generated.h"

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class MYMODULE_API UMyComponent : public UActorComponent
{
    ...
    virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
    ...
}

When I try to package my plugin (either using CLI or through UE), I get the following errors:

error C3668: PostEditChangeProperty: method with override specifier ‘override’ did not override any base class methods

error C2039: ‘PostEditChangeProperty’: is not a member of ‘UActorComponent’

Any help would be appreciated!

.h

.cpp

Compiles no problem on a test project in 5.4

Maybe you need to refresh / regenerate your project?

The lack of editor only macro might also be triggering a problem.

I just added the #if pre-processors around the declaration and definition and that seems to have done the trick. Thank you for including that in your snippet!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.