Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 2.62 KB

README.md

File metadata and controls

37 lines (28 loc) · 2.62 KB

Tanks

This project is a coding challenge and a concept for a Mobile 3D Tank MOBA game.
Currently only single-player tank mechanics are implemented.

Click on the image bellow to check out a gameplay video:
Tanks

Game Heirarchy

heirarchy

The tracks

The tracks are made in blender and they have a single mesh that is weight painted to N separate bones that can be moved up and down either by following the built-in WheelColliders (as in this example) or by Raycasting towards the ground for a non-physics based implementation. tracks

The movement

To create the realistic tank movement I used WheelColliders that get differential torque on each side based on the user turn input. The stiffness of the WheelFrictionCurve scales linearly with the local forward velocity to decrease the turn rate when speed is increasing. Turn input is inverted when the tank reverses.

The trajectory

I wrote a trajectory drawing script that needs a set start point to constantly recalculate the trajectory of a projectile with a given velocty and an input wind velocity vector. The wind affects the calculated trajectory on each update. The Trajectory Game Object is a child of the Tank's Gun so it's calculations are relative to it. A line renderer is used to display the trajectory.

The projectile

When the user hits the fire button it calls the Trajectory Drawer and spawns a new Projectile and the currently calculated trajectory is passed to it as a list of points which are used to dinamically create an Animation with position and rotation keyframes along that path.

Project Map

The scripts can be found at Tanks/Unity Project/Assets/Scripts/

The android apk can be found at Tanks/Unity Project/Build/