How to detect transform change in editor?

I’ve currently attempted to implement the following methods:

  virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
    virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent& PropertyChangedEvent) override;

This was in an effort to detect when the transform of an actor or component change so I can do some custom snapping (on a hex grid for example) in the editor. But neither of these are firing when I use the in-editor gizmo to move the actor, but fire when I manually edit the values in the details panel.

I’ve also attempted to use construction scripts since those fire off even when you drag the actor in the editor and not just manual property edits. But doing any location editing in that context in regards to snapping seems impractical due to not being able to detect when a drag is starting or finishing vs just a manual edit in the details panel.

Any idea how to listen in on gizmo interaction or possibly a better approach?

Try overriding PostEditMove and/or AActor:: EditorApplyTranslation, EditorApplyRotation, and EditorApplyScale (all called from UEditorEngine::ApplyDeltaToActor).

Cheers,

Thanks, that’s what I was looking for!

Answered how to do the same, but for UActorCompoent, here: