Basically it creates a loop that keeps making a part rotate around the axis part and keeps adding 20
to the variable that defines how much it should rotate each loop until it gets to 360 to stop.
However I could not figure out a way to make the bottom point towards the axis part, here’s a demonstration of what i want it to do:
But here you are setting the new part’s cframe to script.Parent.CFrame which might actually make it face torwards the original part, if script.Parent is actually the original part.
But simply
part1.CFrame = CFrame.new(2,2,2, part2.Position)
So you see in cframe, the first 3 paramaters, or the first vector is the position, and the 2nd vector, which here is part2.Position is actually setting where the part is gonna look, we set it to the position of part2 so it is gonna be place at 2,2,2 and will face part2.
But I might be wrong because if script.Parent is actually the original part, and you are indeed setting it direction, because doing
part.CFrame = script.Parent.CFrame
--is littearly the same as
part.CFrame = CFrame.new(script.Parent.Position, script.Parent.Position)
--and i think that this line would error I think because you
--can't set a part's cframe to the same position and same direction
No, they’re not the same. Using CFrame.new(position, look) makes a CFrame at the position with its LookVector pointing at look. Having something look at itself is not the same as preserving something’s rotation.
Also, in your second code sample, you’re not constructing a Vector properly. You would have to do Vector3.new(2,2,2) instead of just 2,2,2.