Workspace.Part1.CFrame = Workspace.Part1.CFrame * CFrame.Angles(0,math.rad(10),0)
This only sets it to that degree. + CFrame.Angles(0,math.rad(10),0) wont work it tells me it needs a vector 3, which I tried and wouldn't work either.
What I plan on doing is adding +1 to math.rad (10) every 1 second. If I do this:
Workspace.Part1.CFrame = Workspace.Part1.CFrame * CFrame.Angles(0,math.rad(10),0) wait(1) Workspace.Part1.CFrame = Workspace.Part1.CFrame * CFrame.Angles(0,math.rad(10),0)
It'll stay at 10, not move on to 11.
You can use the addition operator, +
between a CFrame
and a Vector3
, between a Vector3
and another Vector3
but not between a CFrame
and another CFrame
- the Offical ROBLOX Wiki page on CFrames has a section devoted to explaining the CFrame
Operators.
Because of the way matrix math works (which is what CFrame
s effectively are) a multiplication has an additive affect, so:
part.CFrame = part.CFrame * CFrame.Angles(0,math.rad(10),0) part.CFrame = part.CFrame * CFrame.Angles(0,math.rad(10),0)
Does exactly the same transformation as:
part.CFrame = part.CFrame * CFrame.Angles(0,math.rad(20),0)
If you do use the +
operator with a CFrame
, you must use it in conjunction with a Vector3
- this will work, if it does not, you are doing something wrong and would need to show us what it is for us to help :)
Workspace.Part1.CFrame = CFrame.new(--[[X Axis]],--[[Y Axis]],--[[Z Axis]]) * CFrame.Angles(0,math.rad(10),0)
You would put the position vector in the CFrame.new() parenthesis, just like you would with a Vector3.new()
Workspace.Part1.CFrame = CFrame.new(Workspace.Part1.CFrame * CFrame.Angles(0,math.rad(10), 0))
I believe is correct.