Genete I have a question once again about converting angles to radians etc.
In my aimer script I am using the code from the LM translate bone tool for frame 0. This will "flip" the angle when it hits 0 all the way around to 360. For the original purpose of this code this makes perfect sense. For my purposes this causes a problem.
Here is the code for that angle conversion based on translating the target bone:
Code: Select all
local angle = aimer.fAngle
angle = angle + math.atan2(boneVec.y, boneVec.x)
Is there any "magical" equations in your bag of tricks to convert that angle before applying it that wouldn't cause a constraint to act oddly?
There was some "extra" bit of code from the original LM bone translation tool that I removed for my script:
Code: Select all
--[[
while angle > 2 * math.pi do
angle = angle - 2 * math.pi
end
while angle < 0 do
angle = angle + 2 * math.pi
end
--]]
-vern