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 5 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?

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

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 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
1while true do
2    script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.07,0)
3    wait(0.05)
4end
0
upvote pls :) smash_abIe 19 — 5y
0
Do NOT forget the math.rad. User#27525 1 — 5y
0
isnt this the same as CFrame * CFrame.Angles? biggun428 8 — 5y
0
Not all angles are the same smash_abIe 19 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 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.

1BodyAngularVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyangularvelocity instance.
2BodyVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyvelocity instance.
3BodyAngularVelocity.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) -- This will set the torque to maximum, so it doesn't glitch with other physics.
4BodyAngularVelocity.AngularVelocity = Vector3.new(2, 2, 2) -- This will make the brick rotate 2 studs per second on all axis.
5BodyAngularVelocity.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 — 5y
0
Oops, forgot to say that you have to unanchor the brick User#27525 1 — 5y

Answer this question