Realistic chopping

I’ve been trying to make a chopping system similar to this

credit

I have attempted to get the result with negating parts and voxel models with no luck. And obviously with negating parts, physics don’t apply to parts that have been cut in half.

Just asking if anyone could point me out to the right direction, it would be greatly appreciated.

3 Likes

Okay this sounds confusing but I’ll try my best to help. You could try keeping track of the times they click on the tree and every time they click 1 part disappears.

For example, lets say you wanted a tree to fall after 5 times of clicking/chopping on it. You would have 5 different parts that look like it’s being chopped. So the first part would look slightly damaged, then the second part would look more damaged, etc. Then if it’s their first time clicking the tree, then make the first stage/part visible and the rest not visible, then the second part visible and not the rest, then the third. Once there are no more stages or parts, then make the tree fall.

Okay, but how am is supposed to go about detecting when part of the tree has been mined and then the top remaining half falls?

You could have a Int or Number value inside of the tree and every time you click the tree it goes down by 1. Then if it reaches 0, un anchor the top part of the tree and maybe even give it a very very small force to make it tip over.

Here is the free model I just made for an example
https://www.roblox.com/library/9963299413/Choppable-Tree-For-the-Dev-Forum

Here is a script with comments to let you know what everything does:

local clickDetector = script.Parent -- Get the Click Detector

local tree = script.Parent.Parent.Parent -- Get the Tree

local stages = tree.ChoppingStages -- Get the Stages Folder
local leaves = tree.Leaves -- Get the Leaves
local upperWood = tree.UpperWood -- Get the Upper Wood

local stageValue = tree.Stage -- Get the Stage Value

clickDetector.MouseClick:Connect(function(player) -- Once a player clicks the click detector
	
	stageValue.Value += 1 -- Increase the Stage Value by 1
	
	if stageValue.Value >= 4 then -- Since there are 3 stages, if we are above 3 stages...
		
		for i, v in pairs(stages:GetChildren()) do -- Loop through everything in the Stages Folder

			v.Transparency = 1 -- Set the part to be invisible
		end
		
		upperWood.Anchored = false -- Un anchor the upper part of the tree
		upperWood.Velocity = Vector3.new(10, 0, 10) -- Give it a small velocity for a split second to make it fall
		
		leaves:Destroy() -- Destroy the Leaves
		
	else
		
		for i, v in pairs(stages:GetChildren()) do -- Loop through everything in the Stages Folder
			
			v.Transparency = 1 -- Set the part to be invisible
		end
		
		if stageValue.Value == 1 then -- If we are at the first stage...
			
			stages.Stage1.Transparency = 0 -- Make the first stage part to visible
		end
		
		if stageValue.Value == 2 then -- If we are at the second stage...

			stages.Stage2.Transparency = 0 -- Make the second stage part to visible
		end
		
		if stageValue.Value == 3 then -- If we are at the third stage...

			stages.Stage3.Transparency = 0 -- Make the third stage part to visible
		end
	end
end)

Right, I see. But what about taking the Y axis into account?

1 Like

they are indeed using unions, its just that they make some sort of detection for floating/gaps between union and separates it into 2 different unions

1 Like

This video might help

1 Like

On point my friend, thanks very much!