I’m trying to find a solution to the similar problem as:
I have a Component which I use for custom movement and I want to snap its Owner to the specific World Location whenever said Owner is being moved in the Level Viewport.
This seems to be pretty easy to do for Actors by overriding AActor::PostEditMove
but what if I want to detect it inside of Component?
I could of course access the Owning Actor via UActorComponent::GetOwner but what then? I cannot just override some of the Actor’s functions inside of actual Component (sadly).
Are there any other overridable functions in UActorComponent or USceneComponent that I could use to achieve the similar behavior? Or any delegates that I could bind to?
When AActor moves, what actually moves is its Root Component.
There is a delegate USceneComponent::TransformUpdated and Actor always has the Scene Component at its root so I can easily call GetOwner()->GetRootComponent() and bind something to said delegate. I’m doing this inside of UActorComponent::OnComponentCreated override.