Projects / Unity / Game prototype
Mission Demolition
A slingshot physics prototype with projectile control and destructible structures.
Unity 6000.0.44f1Game prototype8 coursework scripts
Overview
A Unity coursework prototype exploring mouse input, rigid-body projectiles, castle structures, and camera tracking. The source separates launching, goal detection, level management, and projectile-line drawing into small components.
Implementation highlights
- Slingshot input. Slingshot.cs constrains the drag distance and converts the release offset into rigid-body velocity.
- Physics and camera. The scene includes a ground plane, slingshot, and castle structure. FollowCam.cs interpolates the camera toward a point of interest.
- Level and goal logic. MissionDemolition.cs tracks shots and level state; Goal.cs detects goal contact. ProjectileLine.cs implements sampled path drawing.
Project gallery

Inside the code
Assets/Scripts/Slingshot.cs
float maxMagnitude = this.GetComponent<SphereCollider>().radius;
if (mouseDelta.magnitude > maxMagnitude)
{
mouseDelta.Normalize();
mouseDelta *= maxMagnitude;
}
Vector3 projPos = lauchPos + mouseDelta;
projectile.transform.position = projPos;
if (Input.GetMouseButtonUp(0))
{
aimingMode = false;
projectile.GetComponent<Rigidbody>().isKinematic = false;
projectile.GetComponent<Rigidbody>().linearVelocity = -mouseDelta * velocityMult;
FollowCam.POI = projectile;
projectile = null;
MissionDemolition.ShotFired();