Calculate Relative Transform between two points for MoveComponent

Hey, i am currently struggling with the following problem:

Given two World Locations with Rotation, how do i calculate the Relative Location and Rotation for MoveComponentTo so the both Actor actually “map” on these Points in World Space? How would i achieve this for two points, if those are actually inside of two different Actors and those are not at (0,0,0) in Local Space inside the Component?

Context: I am using the VR Template and want to attach an Object to the Users Hands(MotionControllers) at some specific point of the Object, and i am using a Socket inside the Skeleton to do that.
And this works with “Snap To Target” without using the Socket, but i want to use specific grab locations sometimes and therefore i want to use MoveComponentTo with “KeepRelative/KeepWorld” to actually move the Object as specified by the Socket (The Socket essentially should be the Location/Rotation of the attached MotionController, but i want to Move/Rotate the Object to the MC, and not the other way around).

Whenever a implement a transformation to Move to the final Location/Rotation its not as intended, is there any Documentation about this or can anybody explain how i would achieve that? Thanks!

More Info:

  • Actor1 is MotionController_BP

  • Inside Actor1 is a HandMesh at Location (-12,0-2) Rot (90,0,0)[Local]

  • Actor2 is Pickup_BP with a SkelMeshCmp

  • Inside the Skeleton of Pickup_BP is a Socket at Location (50,30,0) Rot (0,45,90)[Local]

It seems to me that i am not correctly considering the Local-Space Transform of both Components (HandMesh, Socket), so all my latest attempts seem to result in a random location/rotation and not the one desired.

Not sure if this will help or not but when it comes to socket location/rotation with transform space problems this node helps.


You can move between local / world transforms using the nodes:

Mouse over to find the relavant node, the crucial part of the description is the end:

All you have to do ( in this example moving from world to local rotation ), is feed in the object world transform, along with the other params:

Thanks for your answers, after digging a bit into it, i realized my Vector Math Skills are not good enough to implement it :smiley:
I am using a Workaround now, by spawning a new (empty) actor, attaching it to the Socket and then set the Location/Rotation of that newly spawned Actor. After that i destroy it again.

ok cool :slight_smile: