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

Angle of my model keep changing when I use CFrame on it. What can I do?

So I had a bunch of cylinders that I've putt in a model. That model was rotated to 90 on Z. So I made a primary part and used CFrame to make the whole model go down.

local upcframe = CFrame.new(x, y, z)*CFrame.Angles(0, 0, 90)
local downcframe = CFrame.new(x, y, z)*CFrame.Angles(0, 0, 90)
local model = game.Workspace.Model
local center = model.randompartfromthemodel

model.PrimaryPart = center

while true do
wait(2)
model:SetPrimaryPartCFrame(downcframe)
wait(2)
model:SetPrimaryPartCFrame(upcframe)
end

But now when it goes down it change the angles. Could it be because I have a part (that is not included in model) below the model? if not, then what can I do to fix it?

5 comments

0

use codeblocks which are ~ so we can read your script correctly

0

Because you're multiplying the angles!! I feel like this isn't even your script since you don't know what you're doing.

0

if I dont the angle will change anyways.

0

I already tried to modify, remove and add angles but it doesnt work. Also what do you mean it isnt my script?

0

I said cylinder not part or brick because they are not like usual parts. They spawn diferently. If I dont add an angle it will still change my model appearance.

1 answer

I finaly found the answer. Because of the buggy angles, I used a brick as the primary part of the model because bricks spawn ,,normaly” so you dont have to rotate them. It took me long enough to figure it out, sometimes I simply dont think about all the ways I can do a job.

Now how do I close this question???

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