local function deg(x, y, z)
return CFrame.Angles(
math.rad(x),
math.rad(y),
math.rad(z)
)
end
task.wait(5)
local startCframe = CFrame.new(3.557, 7.372, 15.031) * deg(12, 102, -17)
local model = workspace:WaitForChild("S10")
if not model.PrimaryPart then
model.PrimaryPart = model:FindFirstChildWhichIsA("BasePart")
end
model:PivotTo(startCframe)
It likely depends on what you are chosing as a PrimaryPart for your Model, I’d try having the RootPart be the PrimaryPart instead of the Head, as it’s probably more centered inside the Model
Nope..it is not working. I even put a print statement to check. Although it printed..the Model seems to be stubborn and only rotates to : -2.478, 101.745, -5.255
Oh my bad…that was an oversite in my part. I changed it to hrp and it didnt make any difference. for some reason it stays on the rotation : -2.478, 101.745, -5.255
Depending on the usecase of the rig why not just unachor it and instead use collssion groups to make sure no one or thing can interact with it? Maybe it’s not working due to it being anchored
CFrame.Angles(rx, ry, rz) uses XYZ order, while the Properties panel shows YXZ order. So the values won’t match even if the rotation is the same.
Also, with big angles (like 102°), you can get gimbal lock, which makes the values look even more random.
So -2.478, 101.745, -5.255 isn’t a bug it’s just the same rotation shown in a different format.
local function deg(x, y, z)
return CFrame.fromEulerAnglesYXZ(
math.rad(x),
math.rad(y),
math.rad(z)
)
end
task.wait(5)
local startCframe = CFrame.new(3.557, 7.372, 15.031) * deg(12, 102, -17)
workspace.S10:PivotTo(startCframe)
Now the angles will match what you see in Properties.
Also check
Your primaryPart is set to head. PivotTo() uses the PrimaryPart, so the model rotates around that.
I figured about the issue…It seems there was a malicious bug in other script(taken from tooblox for testing) which caused this. I had to create a new baseplate project and it seems everything worked out as intended.
For people who replied to this post, i thank you for you’re patience and time.