I’m making models (different fruits) weld onto a chopping board model inside my character. I replicated their position from the original chopping board onto this cloned one using a replica of what it should look like inside of ServerStorage. How would I also calculate the angle to rotate the fruits correctly while using a weld?
CFruit is a model on the chopping board in Workspace
SFruit is a model on the chopping board in ServerStorage (the example board I’m replicating)
SChopping is the chopping board in ServerStorage
Here is what has been so far successful for one of the fruits, but the banana gets flipped upside down, so I’m having trouble finding the true calculations.
local CFruit = SFruit:Clone() WeldModel(CFruit) --Welds it together if there are multiple parts. local X, Y, Z = SFruit.PrimaryPart.CFrame:ToEulerAnglesXYZ() --Gets the original angle CFruit.Parent = ChoppingBoard:WaitForChild("Fruits") CFruit.PrimaryPart.CFrame = ChoppingBoard:WaitForChild("Board").CFrame * CFrame.Angles(X, Y, Z) --idk if the weld overwrites, probably does SetVisibility(CFruit, 0) --make it visible CFruit.PrimaryPart.Anchored = false local Weld = Instance.new("Weld") Weld.Part0 = ChoppingBoard:WaitForChild("Board") Weld.Part1 = CFruit.PrimaryPart local X1, Y1, Z1 = SFruit.PrimaryPart.CFrame:ToEulerAnglesXYZ() --gets the original angle (on server example) local X2, Y2, Z2 = SChopping.PrimaryPart.CFrame:ToEulerAnglesXYZ() --gets the original chopping board angle (on server example) local Difference = CFrame.new(SChopping.Board.Position - SChopping.Fruits[Fruit.Parent.Name].PrimaryPart.Position) * CFrame.Angles(X2 - X1, Y2 - Y1, (Z2 - Z1) * math.rad(180)) --Gets the difference in the position and then tries to in the angles. The board was rotated 180 degrees on the Z axis as well. Weld.C0 = Difference Weld.Parent = CFruit
Here’s what I’m trying to accomplish:
Here’s what happens: