Hello! I have been having a problem…
I want to rotate a part while it moves downwards.
Does anybody know how to? I basically want
the part to ONLY move downwards and not go where its
rotating!!
Its a missile
spawn(function()
task.wait(math.random(1,8)/10)
for i = 0,90 do
game:GetService('RunService').Heartbeat:Wait()
script.Parent.Orientation += Vector3.new(1,0,0)
end
end)
while task.wait() do
script.Parent.CFrame *= CFrame.new(0,-2,0)
end
A CFrame combines positional data with rotational data. You are able to only access positional data with the Position property of a Part and also only access rotational data with the Orientation property of a Part. One solution based on the code you’ve provided may be to set the Position, instead of the CFrame:
while task.wait() do
script.Parent.Position += Vector3.new(0,-2,0)
end
You would also be able to still use the CFrame property, however with the knowledge that adding a Vector3 to a CFrame only affects the positional data of the CFrame, could get the same result as above with:
while task.wait() do
script.Parent.CFrame += Vector3.new(0,-2,0)
end