Skip to content

kdh29/MechaTech-old

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Expedition: Modular — Phase 1

Unity 2022 LTS · 3D modular vehicle combat game.

What's in Phase 1

System Location
BlockData ScriptableObject Assets/Scripts/Data/BlockData.cs
GridPosition struct Assets/Scripts/Core/GridPosition.cs
BlockInstance runtime state Assets/Scripts/Core/BlockInstance.cs
VehicleManager (Rigidbody owner) Assets/Scripts/Core/VehicleManager.cs
BlockBehaviour base Assets/Scripts/Blocks/BlockBehaviour.cs
CabBlock (kill condition) Assets/Scripts/Blocks/CabBlock.cs
ChassisBlock Assets/Scripts/Blocks/ChassisBlock.cs
WheelBlock (raycast suspension) Assets/Scripts/Blocks/WheelBlock.cs
Runtime Build UI (OnGUI) Assets/Scripts/UI/VehicleBuildUI.cs
Editor scene setup Assets/Scripts/Editor/TestSceneSetup.cs

Getting started

  1. Open project in Unity 2022 LTS.
  2. Menu → Expedition › Setup Test Scene.
  3. Press Play — WASD/arrow keys drive the vehicle.
  4. Use the Build Panel (top-left) to add or remove blocks at runtime.

Controls

Key Action
W / S Throttle forward / reverse
A / D Steer left / right

Block face indices

0 = +X   1 = -X
2 = +Y   3 = -Y
4 = +Z   5 = -Z

Architecture notes

  • One Rigidbody per vehicle, always on VehicleRoot. Block prefabs have their Rigidbody components stripped on spawn.
  • Mass and center-of-mass recalculate on every TryAddBlock / RemoveBlock call via RecalculateMassDistribution().
  • Wheel physics run in each WheelBlock.FixedUpdate() — no WheelCollider. Spring → drive → lateral friction applied at the wheel world position.
  • Death condition: VehicleManager.NotifyBlockDestroyed() checks if the removed grid position matches _cabGridPos; if so OnCabDestroyed() fires, detaches all remaining blocks as independent Rigidbodies, and disables the vehicle.

About

An attempt to modernize the gameplay of terra tech for personal use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages