Split a part into 3 and keep rotation

Hi, I have a tree that you can cut down in my game. Once it hits the ground I want it to split into 3 logs. I have that done except for the math. I don’t know how to split it into 3 and keep the rotation. How would I go about this?

The only way I can think of goes like this:

  1. The tree falls and hits the ground.

  2. You save the rotation of the tree (if it’s a part) or a specific part of the tree (if it’s a model).

  3. You have a log that you can store in ReplicatedStorage or similar.

  4. You destroy the tree model via code.

  5. You clone the log 3 times and change their positions to take the shape of the original tree.

  6. You rotate them to match the original rotation.

2 Likes
for _, Tree in pairs(workspace:GetChildren()) do
	if Tree:IsA("BasePart") and Tree.Name == "Tree" then
		local Split = 3
		for i = 1, Split do
			local p = Tree:Clone()
			p.Size = Vector3.new(Tree.Size.X/Split, p.Size.Y, p.Size.Z)
			p.CFrame = Tree.CFrame - Tree.CFrame.RightVector*Tree.Size.X/2 + Tree.CFrame.RightVector*p.Size.X*i - Tree.CFrame.RightVector*p.Size.X/2
			p.Parent = script.Parent
			p.Anchored = false
		end
		Tree:Destroy()
	end
end

TreeSlice.rbxl (33.3 KB)

2 Likes