Ok, two actors.
Each actor has the center point (in red) and four components, each facing away from the center, snapped to 90 degrees.
Actor 1 already exists in the map. On Actor 1, I am running a Event Begin node to spawn Actor 2.
The goal is to feed in a component of Actor 1 and a component of Actor 2 and have Actor 2 positioned in such a way that it is rotated correctly and its component lined up with that of Actor 1. I realize this is an awful explanation, so here’s some pictures.
Ex: I feed in component A and F (“Attach” Actor 2 at component F to Actor 1 at component A)
Actor 1 remains stationary, Actor 2 is rotated and moved to line up with Actor 1 at the specified components.
One more example: I feed in Component C and G
I want to do this completely relative, without using stuff like “If rotation is 90 degrees, move Actor 2 400 units on the X axis”.
So here’s what I have so far.
Feed in Component1 (the component from Actor 1) and Component2 (the component from Actor 2)
- Spawn Actor 2, the transform doesn’t matter (I can’t position it until I can evaluate the components on Actor 2).
- Set Actor 2’s rotation to be Component1’s rotation +180 degrees
- Position Actor 2…???
I have no idea how to properly position Actor 2.
If I do
(Get Actor 1’s Location + Get Component1’s Relative Location), this returns the world coordinates for Component1
From there, I want to make sure I move Actor 2 out in the right direction, so I think I would need to use “Get Forward Vector” of Component1 and somehow obtain either X or Y (how do I know which one is right?) of Component2 and “Get Right Vector” of Component 1 and the X or Y of Component 2.
Ex: Attach A and G
In this case, sure… I know that I would need to move up on the Y axis and right on the X axis, but the idea is that this is all dynamic and relative. After Actor 2 is rotated, I need to get the number of forward units between Actor 2 and Component2 and move forward that many. Then, I need to get the number of right units between Actor 2 and Component2 and move right that many.
I am doing a terrible job explaining this and I really hope someone understands my issue.
I need to set the location of the two components to be identical. The two actors will have rotation 180 degrees difference.