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?
1 | while true do |
2 | script.Parent.CFrame = script.Parent.CFrame*CFrame.Angles( 0 ,math.rad( 7.2 ), 0 ) |
3 | wait(. 02 ) |
4 | end |
I don't know if my computer is just straight up bad or if there's a better way
1 | while true do |
2 | script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ( 0 , 0.07 , 0 ) |
3 | wait( 0.05 ) |
4 | end |
If you want very smooth way to rotate bricks, use bodyangularvelocity. First off, create a bodyangularvelocity, a bodyvelocity and a script inside the brick.
1 | BodyAngularVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyangularvelocity instance. |
2 | BodyVelocity = script.Parent.BodyAngularVelocity -- This is a variable that will represent the bodyvelocity instance. |
3 | BodyAngularVelocity.MaxTorque = Vector 3. new( math.huge , math.huge , math.huge ) -- This will set the torque to maximum, so it doesn't glitch with other physics. |
4 | BodyAngularVelocity.AngularVelocity = Vector 3. new( 2 , 2 , 2 ) -- This will make the brick rotate 2 studs per second on all axis. |
5 | BodyAngularVelocity.MaxForce = Vector 3. 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.