Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I rotate a brick without it being choppy?

Asked by 4 years ago

When I used a this script to rotate a part it ends up looking very choppy or rugged so is there a better way to make it look smooth?

while true do
    script.Parent.CFrame = script.Parent.CFrame*CFrame.Angles(0,math.rad(7.2),0)
    wait(.02)
end

I don't know if my computer is just straight up bad or if there's a better way

0
choppy? Please define it RBLXNogin 187 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
while true do
    script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.07,0)
    wait(0.05)
end

0
upvote pls :) smash_abIe 19 — 4y
0
Do NOT forget the math.rad. User#27525 1 — 4y
0
isnt this the same as CFrame * CFrame.Angles? biggun428 8 — 4y
0
Not all angles are the same smash_abIe 19 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

If you want very smooth way to rotate bricks, use bodyangularvelocity. First off, create a bodyangularvelocity, a bodyvelocity and a script inside the brick.

BodyAngularVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyangularvelocity instance.
BodyVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyvelocity instance.
BodyAngularVelocity.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) -- This will set the torque to maximum, so it doesn't glitch with other physics.
BodyAngularVelocity.AngularVelocity = Vector3.new(2, 2, 2) -- This will make the brick rotate 2 studs per second on all axis.
BodyAngularVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) -- This will set the bodyvelocity force to maximum so the brick can be kept in air.

If this helped, please click the accept answer button.

0
Sorry but the Angular velocity doesnt seem to be making the brick rotate biggun428 8 — 4y
0
Oops, forgot to say that you have to unanchor the brick User#27525 1 — 4y

Answer this question