An experimental project that further developed my understanding of Unity.
Main idea: bullets are not lethal but instead push players back a certain amount; win by pushing the other player off the edge.
Secondary idea: bullets leave trails, player's can activate these trails and use them as terrain to walk on for a short period of time.
Currently Implemented:
3rd-person player movement, including jumping (with gravity), using a character controller. The camera moves accordingly.
Shooting fires (a currently very large) bullet by casting a ray from the center of the screen through the reticle, calculating the point of intersection, and then calculating a direction vector for the bullet to follow (from the barrel of the gun to the intersection point).
A trail renderer is insufficient for bullet trails because it offers no collision detection. Therefore a cylinder is spawned for each bullet trail, then positioned halfway between the bullet's origin and it's current flying position, rotated to align with the bullet's path, and scaled to meet the distance between the bullet's origin and its current flying position. (You can see the bullet trails in the image above).
The idea is to grant players an ability to add an effect to the block, which they gain by standing on it. The grass would be a visual indicator of the effect.
Behind the scenes an expanding mesh for the grass is procedurally generated using a coroutine (to give it a stepping feel). The grass material is attached to this mesh. The mesh starts expanding from the player's collision point with the terrain and moves outwards in rings.
The bullet trails are transformed cylinders instead of the default trail render component. This is so we can detect collisions with them.
All bullets are drawn from an object pool for efficiency and are "despawned" after a certain amount of time.
The first technique uses texture distortion. The texture is broken up into a grid of cells, each of which have a distinct flowing direction. Adjacent cells are overlapped and blended together to hide the grid shape.
The second technique displaces vertices instead of texture coordinates which gives dimension. The technique used is called "Gerstner Waves".
Here the water is now transparent (less so the deeper you go) and refracts light.