you might just need to render step the rotation
doing one tween that leads to 720 (which is just 360*2, which is basically no rotation)
wouldn’t do anything
ive seen people use runservice for rotating but u can still use tween service using the orientation property to change a part’s rotation in a viewport frame. thanks a million for ur help tho wicked!!
hey self, i tried that but unfortunately it wouldnt work for cframe in my case so i just did a quick test and used the orientation property to get it to work and that worked fine.
using the orientation property helped me rotate parts in a viewport frame in my case !
code:
local rs = game:GetService("RunService")
local vpf = script.Parent.ViewportFrame
local part = vpf.Part
local tweenservice = game:GetService("TweenService")
local rng = Random.new()
local function randomRotation()
--returns anticlockwise / clockwise. either between -360 and -720 degrees or between 360 and 720 degrees.
return rng:NextNumber(360, 720) * (rng:NextInteger(0, 1) == 0 and -1 or 1)
--returns anticlockwise / clockwise. either between -360 and -720 degrees or between 360 and 720 degrees.
--return rng:NextNumber(360, 720) * (rng:NextInteger(0, 1) * 2 - 1)
end
local function getTweenInfo(tweenTime)
return TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
end
while true do
local tweenTime = rng:NextNumber(2, 3.5)
local randomRotX = randomRotation()
local randomRotY = randomRotation()
local randomRotZ = randomRotation()
local tween = tweenservice:Create(part, getTweenInfo(tweenTime), {Orientation = Vector3.new(randomRotX, randomRotY, randomRotZ)})
tween:Play()
tween.Completed:Wait()
task.wait(0.01)
end