Hello, so before I try to explain what I am trying to achieve, let me explain the setup
The checked cylinder is my “screw” and the grey cube in front of it with the white arrow is my “tool”.
Red and white arrows indicate the components forward vectors. So red is the forward of the cylinder, white is the forward of the tool.
What I am basically trying to achieve is that I want to turn the screw if the tool is in the correct rotation to the screw.
Also I want the screw to rotate when i rotate the tool, just like tighten up a screw.
I got the main problems in working with rotators here.
I could use the rotator of the tool for the screw, but that would result that the red arrow is parallel / facing in the same direction as the white arrow.
Well, when doing that, the screw would at least rotate together with the tool.
But I would like to keep this angular offset between both arrows.
I got that working once, but that required that the screw would face in that specific world direction.
When trying to rotate the screw around 90 degrees like in the following image, my algorithm didn’t work any longer.
I got that problem solved (I think) by using the screws Up-Vector to make a Rotator via “MakeRotFromZ”, but I don’t know how to translate the rotation of the tool to the screw and without forgetting the angle offset between them as well.
If I am not mistaken, then I can’t simply split the rotator of the screw and add Yaw, Roll or Pitch. Neither can I combine or Add a Rotation. Or maybe I am doing something wrong.
How do I get this construct working for any rotation / direction the screw is heading?
Also here is the part of the blueprint where I am trying to synchronize the rotation of the tool to the screw:
The Exec that is coming from the top it from the Tick Event, so this gets called every tick (well, only if the tool fits the screw).