How do I change the orientation of a model

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to rotate a model
  2. What is the issue? Include screenshots / videos if possible!
    well I try coding it but it doesn’t work
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    yes and the ones I’ve seen they only change the orientation and not the position of the model aswell
spawnedENGINE:SetPrimaryPartCFrame(CFrame.new(-193.361, 128.26, 2159.586),CFrame.Angles(0,math.rad(100),0))

2 Likes

Just multiply the cframe.new by the cframe.angles to combine the two

1 Like

ok so i did this

spawnedENGINE:SetPrimaryPartCFrame(CFrame.new(-193.361, 128.26, 2159.586*CFrame.Angles(0,math.rad(100),0)))`
and it doesnt move

1 Like

make sure the primarypart is there

local primaryPart = spwanedENGINE.PrimaryPart
primaryPart.CFrame = primaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,100,0)

yes it is there there there there

1 Like

wiches the angles i put how do i multiply

I think the problem is just that you forgot to end the parenthesis

spawnedENGINE:SetPrimaryPartCFrame(CFrame.new(-193.361, 128.26, 2159.586)*CFrame.Angles(0,math.rad(100),0))

try my script let me know if it works or any errors

it rotates but it doesn’t change position

Using Model:SetPrimaryPartCFrame is getting deprecated soon, so I recommend you to use Model:PivotTo(CFrame.Angles(0,math.rad(90),0) to rotate the model instead.

4 Likes
local primaryPart = spwanedENGINE.PrimaryPart
local targetpos = CFrame.new(-193.361, 128.26, 2159.586)
primaryPart.CFrame = targetpos * CFrame.fromEulerAnglesXYZ(0,100,0)
3 Likes

You could just

local cf = CFrame.new(0,10,0) * CFrame.Angles(0,math.rad(90),0)
1 Like

alright thanks for helping me it works