Listen on actor transform

Hi,
is it possible to get notified by an event if an actor is transformed (changes position, orientation or scale)?
In editor, if I change a transformation value by keyboard (type in values) the event OnRegister() is raised.
But what event is raised when I move the actor by mouse in view?
And are there similar events in game mode?

Maybe someone could give me a hint. Could not find an answer in the API doc.

Greets, solarisx

Google around for more info its easy to find. Example included in API link.

Hi Nachtmahr,

thanks very much for your answer. It put me some steps forward, but I end up like Antidamage in this thread:

https://forums.unrealengine.com/archive/index.php/t-114058.html

The problem is: I have an Actor which I can not inherit, but I can add my custom Component to it. Now I would like to listen on the actors::PostEditChangeProperty from my custom Component. It seems a delegate would be the tool for this, but is there one from Actor to Component? This does not work:

FCoreUObjectDelegates::OnObjectPropertyChanged.AddRaw(this->GetActor(), this->MyPostEditChange());

Greets solarisx

Thats not the proper way to use delegates. You can find more about the usage in the Docs again.

In your case specificly Multicast Delegates:

Also make sure that the function has the same Parameters.

void UMyComponent::MyPostEditChange(UObject* Object, FPropertyChangedEvent& PropertyChangedEvent)

FCoreUObjectDelegates::OnObjectPropertyChanged.AddRaw(this->GetActor(), &UMyComponent::MyPostEditChange);

Good Luck =)

Thanks for this code! Have to use

FCoreUObjectDelegates::OnObjectPropertyChanged.AddUObject(this,&UMyComponet::MyPostEditChange);

because UMyComponet is inherited from UActorComponent.

MyPostEditChange is called when I change e.g. the Location value in the gui by keyboard value input. But how to get a notice when dragging by mouse in the viewport? See image:

138892-drag_geo.png

I think AActor::EditorApplyTranslation is called on a drag by mouse. Next step, how to bind an event on this to catch it in UMyComponent : UActorComponent?

Tried to inherit from USceneComponent instead and override PostEditComponentMove without luck.

I’m happy about any hint on this topic,
greets solarisx

Well its a virtual function so you can override it. Inside that Function GetYourComponent->DoThings()

Can I ask what you are trying to achive overall? Generaly speaking good Component based Design should be as decoupled as possible. Sounds more like you want a simple CustomActor instead of a Component.

Thanks for your patience. I write a plugin for editor and game to link on actors and track/react on their changes. In editor the user selects an actor, presses add button in my plugin gui and the plugin links on this actor. For the link I create an UMyComponent : public UActorComponent and add it to the actor. Maybe there is a better way to link and track an actor?

If the actor gets translated by number (keyboard) input the plugin gets notified through UMyComponent:

FCoreUObjectDelegates::OnObjectPropertyChanged.AddUObject(this,&UMyActor::PostEditChangeDelegateBind);

But if the actor gets transformed by mouse drag in the editor viewport, the plugin gets not notified. I can not inherit or replace the AActor, because I don’t know if the selected actor is already a custom actor. So I think overriding AActor::EditorApplyTranslation and putting my code in it is not possible. I am wondering why overriding PostEditComponentMove does not work, when using UMyComponent : USceneComponent. Maybe I misunderstand the documentation.

If it is still unclear, I can provide a sample plugin project in the next days?

Did you get this solved? I am looking into something similar.