Hey. I have an item that I want to slowly rotate in a circle, but I don’t know if this requires a script or something else. Here is my script so far:
Hey. I have an item that I want to slowly rotate in a circle, but I don’t know if this requires a script or something else. Here is my script so far:
You will need to use Tweens, CFrames or animations. All require scripts, as physics based ones usually. If out or do not rotate at a constant rate smoothly.
I have no idea how to do any of that lol
first the code will not work, first you’re setting Rotation
to true, true is a boolean and Rotation requires Vector3. Second you’re parenting the script to a rotation curve key and at the same time checking if that rotation curve key is = 15. The the last part just isn’t a thing, speed
is not a valid member of Rotation.
So let’s make a working one and understand what each thing does.
--First lets make a loop that won't yield (stop the rest of the script from running)
game:GetService("RunService").Stepped:Connect(function() --runs each step of the server
local part = script.Parent
part.Orientation += Vector3.new(0,1,0) --Add 1 degree on the Y rotation (+=) adds to the current number (-=) does the opposite (*=) multiply by current value (=) set current value to a completely new value (==) returns true or false depending if the thing before the = is the same as the one after
end)
that should work
There is the Roblox Documentation to look at. Consider checking there.
oh yeah i forgot one thing hold on
now try, recopy the script i edited the post
Also, do I anchor the part or leave it unanchored?
anchoring it will give a better results, you can leave it unanchored but it might start flipping out if it starts colliding with things
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.