I am terrible at Vector3 and CFrame so bear with me.
Here's the code I have:
repeat part.Rotation = Vector3.Z(0) + Vector3.Z(-1) wait(0.1) until part.Rotation == Vector3.new(0,45,-180)
What can I replace this code with?
Any answers are greatly appreciated.
First of all, It's best to use the CFrame property of the part. Try placing a block just under another larger block and change the rotation. You will see what I mean.
We can use a simple for loop with the lerp method of cframes to easily do this.
-- We use '0, 1' because the percent complete of a CFrame will take a value from 0 to 1. -- 0 being absolutely no progress and one being complete. -- in 0, 1, 0.1, '0.1' is what increment to change from. So the loop looks like this. --[[ 0 0.1 0.2 0.3 --etc --]] for i = 0, 1, 0.1 do part.CFrame = part.CFrame:lerp(CFrame.Angles(math.rad(0), math.rad(45), math.rad(180)) * part.CFrame, i) wait() end