Auto-Generating Foliage and Rocks!

It will generate as soon as the server starts! I will be using all this terrain for my new farm game. Currently only the grass grows. Very slowly I might add :stuck_out_tongue: Eventually the trees will grow (my current project). I was considering making different levels of terrain but it’s allot of work for little practical gain with my game.

Pretty cool. o:

Idea: Randomly rotate the rocks/plants. They all look very similar to each other. It might add to the overall look of the place.

Pretty cool. o:

Idea: Randomly rotate the rocks/plants. They all look very similar to each other. It might add to the overall look of the place.

[quote] Pretty cool. o:

Idea: Randomly rotate the rocks/plants. They all look very similar to each other. It might add to the overall look of the place. [/quote]
Thanks! :woohoo:

Due to the collision checking, I can’t rotate the stuff that much. The rocks can’t be rotated more than 90 degrees and same with the plants. Small rocks and grass can be rotated more though.

So it turns out my rotation wasn’t taking into account the rotation of the base brick when positioning the visible detail blocks…

I’m not sure where I got this from, but I used it in many of my games (I think it was from crazyman32…)

[spoiler][code]function RotateModel(model,axis)
center = model:GetModelCFrame()
local origin = {}
for _,child in pairs(model:GetChildren()) do
if child:IsA"BasePart" then
origin[child] = center:toObjectSpace(child.CFrame)
end
end
for i = 1,1 do
center = center * axis
for part,cf in pairs(origin) do
part.CFrame = center:toWorldSpace(cf)
end
end
end

RotateModel(MODELNAME,CFrame.fromEulerAnglesXYZ(ROTATION)[/code][/spoiler]

I deleted some parts that were for my game, so tell me if it doesn’t work. I may have removed something important. :stuck_out_tongue:

Forest (randomly generated) - Roblox Would you like this?

External Media

It looks nice :slight_smile: Definitely a different style than my own.