Hey developers I feel stupid not knowing this but how can I continoulsy rotate a part around its complete 360 degrees, I am unsure what to do and the best i’ve come up with is
local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true, 0)
local Goals = {
Orientation = Vector3.new(0, 90, 0)
}
local tween = TweenService:Create(script.Parent, Info, Goals)
tween:Play()
The goal is to give a portal effect so all help would be appreciated.
try this, put the script in the part you want to rotate
Speed = 0.5 -- how fast it spins
while true do -- infinite loop
for i = 0, 360, Speed do
script.Parent.CFrame = CFrame.new(script.Parent.Position)*CFrame.fromEulerAnglesXYZ(0, math.rad(i)*-5, 0) -- move "math.rad(i)*-5" to other parts of the rotation if you want it to rotate differently, or very simpily just rotate the part
task.wait()
end
end
-1 makes it go unlimited times thats not the issue man. What I have there rotates it 90 degrees then brings it back I’m unsure how to make it do the full 360
try this, i moved the math.rad over so it doesnt rotate the same way
Speed = 0.5 -- how fast it spins
while true do -- infinite loop
for i = 0, 360, Speed do
script.Parent.CFrame = CFrame.new(script.Parent.Position)*CFrame.fromEulerAnglesXYZ(0, 0, math.rad(i)*-5) -- move "math.rad(i)*-5" to other parts of the rotation if you want it to rotate differently, or very simpily just rotate the part
task.wait()
end
end