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

Can Parts simultaneously change position while rotating?

I have a model that gets a number added to its position every 0.01 seconds, and in that model is one part that rotates by Y every 0.01 seconds. My script seems to not want to do these 2 things at once. Is this how this works? Is there a workaround?

1 comment

0

Show your code

1 answer

Yes! They can. The easiest way to do this with a part, we will assume its anchored since you didn't specify, if setting the CFrame. In your example, we would do something like this:

Model = *Model Instance*
AddInterval = *Integer to move the model by, EX: 1*
RotateInterval = *Integer to rotate the model by (IN DEGREES), EX: 5*
while wait(0.01) do
    Model:SetPrimaryPartCFrame(Model.PrimaryPart.CFrame+(CFrame.new(AddInterval,AddInterval,AddInterval)*CFrame.Angles(0,math.rad(RotateInterval),0)))
end

Just fill in the variables at the top. If you meant when the part isn't anchored, then comment and ill provide a solution for that.

EDIT: MAKE SURE THE MODEL HAS A PRIMARY PART!!!

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