I have a simple placement system, where you can click to place a brick. But I want to know how I can rotate much more complex models (Models with way more parts and stuff). Currently my system uses :SetPrimaryPartCFrame(CFrame) to position parts, but I would like to know how I would rotate a model. I can obviously set the orientation of every part in the model to be the same but thats not going to work. And for some reason roblox does not have a :SetPrimaryPartOrientation() which sucks.
Using CFrame.Angles maybe?
like:
model:SetPrimaryPartCFrame(CFrame * CFrame.Angles)
But what angle should I set it to?
well, depending on how you want to rotate it.
To rotate it 90 degrees, do
model:SetPrimaryPartCFrame(model.Primarypart.CFrame * CFrame.Angles(0,math.pi/2,0))
1 Like
90 degrees = pi/2 radians not pi/4
1 Like
Out of curiosity why do we not use CFrame.Angles(0, 90, 0)?
Because that’s how it is implemented
(angles can be described in degrees or radians and they chose to use radians in that case)
1 Like
You can do that by turning it into a radian:
CFrame.Angles(0, math.rad(90), 0)
1 Like