Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make a windmill spin, Already made a script just need to fix it , how do i do that?


while true do
	script.Parent.Orientation  + Vector3.new(3,0,0)
	wait (0.01)
end

1 comment

0

line 2 should be script.Parent.Orientation = script.Parent.Orientation + Vector3.new(3,0,0)

1 answer

✓ Accepted answer

Well, changing the orientation of the part to make it look spin is not a good practice. Instead, try using CFrame.Angles. Here's what you might do:

local Part = script.Parent

while wait(0.01) do
	Part.CFrame = Part.CFrame * CFrame.Angles(math.rad(3), 0, 0)
end

Explanation :

CFrames are better than Vector3. Here, CFrame.Angles is used to determine the orientation of the 'Part' and math.rad is used to convert Angles into Radions.

Lemme know if it helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.