As the title, I’m trying to make a part spin (it has a light inside it)
First of all, the code doesn’t error, It doesn’t do what it’s supposed to. And it’s slow / and I can’t change the speed it needs. Perhaps I could use tweenservice if someone could help out? I never experienced tweenservice with rotating a part…
Code:
while true do
script.Parent.Parent.AlarmModel.LightRotate.Orientation += Vector3.new(0,1,0)
wait(0.05)
end
Please let me know what I’m doing wrong, this thing is just lagging.
Local part = yourpart
Local thetween = game.TweenService:Create(part, TweenInfo.new(secondsthetweentakes),{Orientation = Vector3.new(your,orientation,here)})
thetween:Play()
If it’s making a full rotation, you simply play the tween again, with some logic that waits for completion.
You can just make the default Y orientation of the part set to 0, then you can tween it with:
local part = --your part goes here
local tweenTime = --your tween time goes here
local thetween = game.TweenService:Create(part, TweenInfo.new(tweenTime), {Orientation = Vector3.new(0, 360, 0)})
thetween:Play()