I am trying to rotate Y axis orientation of m model to the same Y axis orientation of f model
error Unable to cast bool to CoordinateFrame
game.Players.PlayerAdded:Connect(function(plr)
local m = game.Workspace.Modelz
local f = game.Workspace.Modelb
local a, u, c = f:GetPivot():ToOrientation()
local Orientationb = math.deg(u)
local W, T, H = m:GetPivot():ToOrientation()
local OrientationT = math.deg(T)
m:PivotTo(CFrame.new(m:GetPivot().Position) == Orientationb)
task.wait()
print(OrientationT)
end)
local p1 = workspace:WaitForChild("Part_1") -- .PrimaryPart -- for a model
local p2 = workspace:WaitForChild("Part_2") -- .PrimaryPart -- for a model
local rs = game:GetService("RunService")
local s1 = 0.03699125043077515
while rs.Stepped:Wait() do
p1.CFrame *= CFrame.fromEulerAnglesXYZ(0, s1, 0)
p2.Orientation = p1.Orientation -- + Vector3.new(0,90,0) -- for an offset
end
This is super smooth and can do very slow rotations if needed.
For a model the PrimaryPart needs to be set to the part inside.
(click on PrimaryPart in the model’s Properties window then click on the part inside)