
Proc-Gen Tree Creator (Unity 2D Demo)
This is an interactive demo for my own procedurally-generated 2D tree prop generator made in Unity 6, using splines and Unity's 2D Sprite Shapes package. ------------------------------------------------------------------ Made with very limited time in ~12 hours for UWE Bristol's Starting Block Game Jam 2026, with the theme of "Grow Something New". Controls: Left Click - Move cameraSpace - Place new tree at the current mouse positionRight Click - Delete currently-selected tree ------------------------------------------------------------------ Technical Info: This was a short coding exercise I did to relearn Unity's APIs for handling splines and Sprite Shapes, and was initially going to use Unity's other splines API through the implementation of a Lindenmayer system. However, plugging in custom parameters to this more fractal-like approach turned out to be quite difficult (and bad for performance). Instead, I made my own randomised system that used Sprite Shapes for the tree's branches, while making the leaves separate sprite objects that can be generated separately. Branches are given randomised "knot" positions of varying lengths, widths, and colours, while their left/right tangents are manually calculated to make them look smoother and more naturally connected. Thinner branches, which are not connected to the base roots of the tree, are also given shorter lengths to make the tree look more natural. Meanwhile, foliage generation is done by simply instantiating leaf objects at random branch joint positions, while also prioritising generating foliage for the tops of branches. Source Code: COMING SOON (?) ------------------------------------------------------------------ Credit to Brogan89 for their extension method which lets me retrieve a position between multiple knots on a Sprite Shape spline: https://discussions.unity.com/t/how-to-move-an-object-along-a-spline-spriteshape...Also check out 'Smash that Sacrifice Button', another game jam submission I neglected to contribute to due to my mad tree-generating experiments: https://kazoo1hu.itch.io/smash-the-sacrifice-button
wiz 23 followers· portfolio 12 View creator →