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.
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:
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:
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:
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?