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

How to smoothly orientate?

Asked by 5 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

So I already know using Orientation you can rotate an element via script but the thing is it is very snappy. How would I achieve this smoothly? Linear Algebra?

0
CFrame.Angles() EXpodo1234ALT 18 — 5y
0
Don’t use orientation as it accounts for collisions with the part. You need to directly change the part’s CFrame. To make it smooth, you might want to try TweenService. Rheines 661 — 5y
0
You don't need to use CFrame. You can still rotate it smoothly without it. namespace25 594 — 5y
0
CFrame is just one way. You can also use BodyAngularVelocity. Rheines 661 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

This is one-way:

local part = script.Parent
local speed = 3 -- Speed at which the part will rotate.

while true do
    part.Orientation = part.Orientation + Vector3.new(0, speed, 0) -- Set the rotation every 0.01 seconds.
    wait(0.01)
end
0
Thanks Dev_Coda 31 — 5y
Ad

Answer this question