I am attempting to make some external wing pylons for my jet hold a static orientation as the wings move by comparing their lookvector with the root part lookvector and setting their target angle to that angle.
My issue is they are only set to half the angle they are supposed to as the angle of the wing changes.
Video (the pylons on the wings are supposed to be parallel to the aircraft body but go out at half the angle I want them at):
https://gyazo.com/bd120c71682e963cc1a5d7f61a68a887
I have tried doubling the angle the function produces, but it only makes them spin around. Even though I know of some alternatives I feel like this one is just a lot more straightforward.
Function (ran with heartbeat function):
function Stores:UpdateRot()
local pylon = self.pylon
local root = self.root
local hinge = self.hinge
local dot = root.CFrame.LookVector:Dot(pylon.CFrame.LookVector)
local angle = if pylon.Parent.Name == 'RStores' then DEG(ACOS(dot)) else -DEG(ACOS(dot))
hinge.TargetAngle = angle
end