Overview
My objective for this project was to replicate the arboreal locomotion of gibbons as a player movement system. To capture the swinging gameplay fantasy promised by this form of movement, I developed a mouse-only player controller built solely on the mouse's ability to be swept back and forth.
Mouse-based swinging mechanic
Gibbons move between branches by swinging their body like a pendulum, relying on momentum to pivot freely to the next branch. To replicate this system of movement, I designed a player character consisting of a "body" attached to two ropelike arms. The arms possess a degree of elasticity, letting the player sling themselves between handholds by pulling themselves in the direction of where an arm has most recently been anchored.
Left/right clicking while hovering over an object anchors the corresponding arm to that object. When the player is anchored to a handhold, sweeping the mouse back and forth will apply directional force to their body. This effectively turns the player's body into a pendulum, letting them swing within range of handholds that were previously out of reach.
Procedural animation and physics
The player is procedurally animated using a combination of hinge joints and IK handles. Each part of the body is influenced by the player's momentum as they swing between handholds, providing a natural quality to their movements. Beneath the skeleton, the player consists of a rigidbody capsule attached to a pair of cubes.
GPU leaf instancing system
To create foliage without impacting the game's performance by introducing thousands of unnecessary leaf objects, I developed a tool for drawing a matrix of leaf-shaped meshes on the surface of an object using a single render call. The rotation, animation loop, and color value of each leaf is determined inside of its material depending on where it was generated.