So, I’ve always been confused with BodyGyros as their not straight forward. I got some help to rotate an object using this code below. I have been trying this on another part, Maxtorque at inf, D at 250 and P at 3000. It seems to rotate only 90 degrees or just not at all. Any help?
local part = script.Parent.Parent.StageThree.ThirdStageFuelTank
local bodyGyro = part.BodyGyro
local BodyVelocity = part.BodyVelocity
local x = 0
x += 0.05
repeat
bodyGyro.P = bodyGyro.P + x
wait(0.5)
until( bodyGyro.P == 1000 )
wait(5)
bodyGyro.CFrame *= CFrame.Angles(math.rad(45), 0, 0) ```
local part = script.Parent.Parent.StageThree.ThirdStageFuelTank
local bodyGyro = part.BodyGyro
local BodyVelocity = part.BodyVelocity
local x = 0
while true do wait(0.1)
x += 0.05
end
repeat
bodyGyro.P = bodyGyro.P + x
wait(0.5)
until( bodyGyro.P == 1000 )
wait(5)
bodyGyro.CFrame *= CFrame.Angles(math.rad(45), 0, 0)
local part = script.Parent.Parent.StageThree.ThirdStageFuelTank
local bodyGyro = part.BodyGyro
local BodyVelocity = part.BodyVelocity
bodyGyro.CFrame=part.CFrame
local x = 0
while true do wait(0.1)
x += 0.05
end
repeat
bodyGyro.P = bodyGyro.P + x
wait(0.5)
until( bodyGyro.P == 1000 )
wait(5)
bodyGyro.CFrame *= CFrame.Angles(math.rad(45), 0, 0)
local part = script.Parent.Parent.StageThree.ThirdStageFuelTank
local bodyGyro = part.BodyGyro
local BodyVelocity = part.BodyVelocity
bodyGyro.CFrame=part.CFrame
local x = 0
repeat
x += 0.05
until bodyGyro.P == 1000
repeat
bodyGyro.P = bodyGyro.P + x
wait(0.5)
until bodyGyro.P == 1000
wait(5)
bodyGyro.CFrame *= CFrame.Angles(math.rad(45), 0, 0)
It doesn’t look like you’re changing the CFrame within loops. Body gyros only move towards their CFrame, so if you want it to keep rotating it you’ll have to keep changing the CFrame or use a body angular velocity.
local part = script.Parent
local bodyGyro = Instance.new("BodyGyro")
bodyGyro.Parent = part
wait(5)
bodyGyro.CFrame *= CFrame.Angles(math.rad(-45), 45, 0)