How to do a local (relative) transform in Blueprint?
I have two Blueprints placed in the world. One of the is set as the "root" of the other:
So, when I edit the second blueprints´ transform, it is adjusted relative to the first ones:
eg. my first blueprint is rotated in the world, so it´s local x direction is not the worlds x direction, and when I edit the second ones x location, it is transform in the (rotated) direction. This is great btw, it´s exaclty what I want.
Now I want to apply the transformation of the second one within the level blueprint. But I want to do it exactly like in the editor, so the transform is relative to the first blueprint. But how can I do that???
This is my first try: Composing the world transform of the first blueprint with another transform, and applying it to the second blueprint. But the problem is, the transform then is not done relative to the (rotated) coordinate system of the first blueprint, but only to the world coordinate system.
asked Oct 29 '18 at 09:37 AM in Blueprint Scripting
Ok I figured it out. I just needed to swap the inputs of Compose Transforms. I guess Transform A is first applied and then Transform B.
So first, the wanted relative transform (say 1 cm in X direction) is applied, and afterwards the whole translation and rotation of the first blueprint - which makes the first transform relative to the second one.
answered Oct 30 '18 at 09:34 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here