So, This is the issue in detail and some examples to make it easy to understand:
- I have an object with a BodyGyro that will always point to the current Mouse.Hit, but I don't want it to go try pointing towards it instantly.
- I'm trying to give the BodyGyro target a "rotation limit" each time the loop body runs, in this case, it will be 5°.
- I want the BodyGyro to try point towards the current Mouse.Hit without rotating more than 5° each axis everytime the loop body runs.
Basically what I want to do is to make the BodyGyro rotate the object from one CFrame to another CFrame with a constant angular velocity, but I have my reasons for not using BodyAngularVelocity and not changing the Dampening and MaxTorque factors. (The MaxTorque factor is inf. in all three axis.)
Now, I can change the BodyGyro target either using CFrame.new(objectPosition, newTarget)
or CFrame.Angles(x, y, z)
.
Alright, let's go make the code already:
local RotationLimit = 5 --it can be math.rad(5), i don't know... while wait(0.25) do --We need to rotate the BodyGyro position here... end
Well, I can't come up with a way to make a newTarget
that will rotate the object no more than 5° each axis towards the Mouse.Hit everytime the loop body runs...
I can't come up with a CFrame.Angles()
solution either, which I think is WAY more difficult than the first solution option.
Does someone know what I can do to solve this problem? If so please comment or answer what you think might be a good way to solve this, explanation would be appreciated.
Thanks for reading and hope someone figures this out.