How to make a chopable tree? (UNSOLVED)

Hi! I am trying to make a chopable tree where you can cut where ever you want, if you cut a piece of wood from the tree it becomes annother part and isnt a part of the tree anymore. What I mean by this is that it creates a new part with the same shape that has ben cut off (maybe I can use Instance.new here?). I already made a working chainsaw but I really dont know how to do a script for the tree. Does anyone got some ideas? Also the tree is a mesh, maybe I need to make a hitbox with invisible parts in the tree? Here´s a video which explains what I want to achieve:

I am not asking for whole scripts here but I need some parts of scripts or just some ideas that might help me.

1 Like

Not sure if this would help in any way, but you could try.

1 Like

that might help I will try it later

1 Like

try to make the tree made of some parts with weld and when chop the part destroy the weld
and with mesh it will be hard to use instance

2 Likes

With meshes that would be kinda hard.
but here is an example of one which uses just parts.
https://i.gyazo.com/6fc847095ca1db791e565071f939bee5.mp4

So if u want to do something like this u need to get where the mouse has hit the log.
like this

local mouseHit = mouse.Hit.p

local ObjectCF = Target.CFrame:PointToObjectSpace(mouseHit) -- gets the cframe depending from the hit log

local SplitCF = CFrame.new(0,ObjectCF.Y,0) -- thats the split position, we use the ObjectCF to get the center of the log (Make sure your log size is longer at Y axis)

-- from here u just create the new logs 
local newlog1 = Log:Clone() -- thats just an part saved somewhere
newlog1.Parent = workspace
newlog1.Size = Vector3.new(1,Target.Size.Y - math.abs(SplitCF.Y),1)
newlog1.CFrame = (Target.CFrame * SplitCF) * CFrame.new(0,newlog1.Size.Y/2,0) 

local newlog2 = Log:Clone() 
newlog2.Parent = workspace
newlog2.Size = Vector3.new(1,math.abs(SplitCF.Y),1)
newlog2.CFrame = (Target.CFrame * SplitCF) * CFrame.new(0,-newlog2.Size.Y/2,0) 

1 Like

if it worked can you give me solve :slight_smile:

I am trying everything out right now lets see which idea here works

I think it will work but whats Target supposed to be? local Target = ?

As @kalabgs stated

If you still really want to make it work with meshes you could have certain “points of interest” So say you cut one of the stem lines then it will directly cut off the middle intersection instead of where you hit, whilst this may not be exactly what you want you can then essentially have a table of “point of interest” meshes to apply to the cut off part. Still highly recommend that you just don’t use meshes if you want this kind of behaviour as finding a solution to the most desired visuals would pose a challenge.

1 Like

maybe I should try modelling the tree in blender to multiply parts or should I use normal roblox parts?

Just make the tree divided into a ton of parts horizontally in blender

1 Like