-
What do you want to achieve?
I’m trying to replace one model with another but in the exact same place and oriented the same way. -
What is the issue?
Moving the second model to the first model’s position works fine but changing the orientation of the second model to the orientation of the first model is where I’m running into issues.
local logs = game.ReplicatedStorage.logs:Clone() -- logs is the second model
logs.Parent = workspace
logs:MoveTo(Vector3.new(fallenTreeLog.Position.X, fallenTreeLog.Position.Y, fallenTreeLog.Position.Z)) -- fallenTreeLog is the first model I'm trying to replace with the second
local pivot = logs:GetPivot()
local rX = math.rad(fallenTreeLog.Orientation.X)
local rY = math.rad(fallenTreeLog.Orientation.Y)
local rZ = math.rad(fallenTreeLog.Orientation.Z)
logs:PivotTo(pivot * CFrame.Angles(rX, rY, rZ)) -- This is where I'm running into trouble
fallenTreeLog:Destroy()
Any help is appreciated, I can also provide more information if needed.