Tree Growth System

Hello. I’m trying to make a system that will spawn trees and grow them using GrowthStages (“Baby”, “Medium”, “Adult”), I have done the system that register and index the trees but I don’t know how could I make their growth. I was inspired by Lumber Tycoon 2 system and Tree Generator module

Made by: @Chest_games

But I don’t understand the magic behind it. If anyone knows how I could make it real please respond.
Anyways thanks for reading.

2 Likes

You can do something like
local Tree = workspace.MeshPart
Tree.MeshId = “BabyTreeMeshId”
wait(“number here”)
Tree.MeshId = “MediumTreeId”
wait(“number here”)
Tree.MeshId = “AdultMeshId”

I hope this helped.
Btw this is a very basic growth system.

I don’t want strictly set trees, I want them being generated randomly.

Oh ok use: math.random()
I dont know how to use math.random as I am not a programmer but there is many tutorials on YouTube

You don’t understand what I’m trying to make look at the module I’ve said in the post

Hi, i’ve actually never played lumber tycoon but im supposing you mean growth stages once it reaches a certain point like Dinosaur Simulator (if youve ever played that)
What you can do:
Make a numbervalue, set it’s name to which every growth stage you want it to:
babyStage
Make a script that checks if the numbervalue has hit 100 or a certain point when it will respawn the player as the next growth rate and repeat untill you want it to stop. Example:

While true do
wait()
if babystage.value == 100 then
(what ever you want here)
end

for it to generate randomly you can make like 100 different sets of trees and the game will randomly choose for which tree a player will become, unless you want the tree parts to just start growing randomly or change shape sizes you can mess around or orginposition, orientation, and size with wields that hold them together
if that still doesnt solve your problem then mess around with tween services
if all those still dont work then no idea

As far as branching and making them bigger, you can just use recursion and coroutines. However if you want to make set models bigger then you’ll have to create a custom function as to scale all parts individually, and then offset them.

With this, you’re not creating any premade models apart from possibly the actual parts for the branches and leaves. They’ll be 100% procedurally generated :slight_smile:.

Yes I know that already but the mathmetics like how to calculate new log of the tree etc.

Well, if u want stages, u can use this same module i made, by changing the BranchGenerator function, so u could make the stages with how many branches the tree would have, but u would need to mess a lot with that function

I don’t know how to use your module. I don’t even understand your module :confused:

U can’t understand it, or u can’t make it work? cuz it’s a little tricky to tell the script where the spawn point of the tree should be

Well I can’t understand how do you calculate all the positions, I can do start position for tree but positions for another logs I’m just too stupid I guess

Take a look at cframing, i also had some problems with that, i asked for help at the rodevs discord server, i got this answer, when rotating the next branch u need to set it’s cframe to – >

local BranchCframe = firstwoodpart.Cframe * CFrame.new(0,(firstwoodpart.y)-.2,0) * CFrame.Anlges(randomized rotation) * CFrame.new(0,Branch.Size.y/2,0)

What are you calculating with this?

The position of the next branch, its supposed to give the rotation of the branch in relation with the woodpart the branch is growing from

So that means when I use the main part of the tree that this calculation gives me position of branch?

yes, that’s the formula for getting rotation with a ringe part, u can see it working way better at the roblox documentation, there CFrame:Inverse is used, but i’m dumb so i didn’t like to use that

I don’t even know what CFrame:Inverse does lol