build a mvp of 3d game fighter
- User
build a mvp of 3d game fighter
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
build a mvp of 3d game fighter
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below is a practical “recipe” for getting a playable 3-day / 1-weekend MVP of a 3-D fighter up and running in Unity. Feel free to remix anything to fit Unreal, Godot, or your own engine of choice—it’s all transferable concepts. 🎮🥊
Time-boxed target: ~10–12 hours of work spread across one weekend.
| Feature | Included in MVP? | Nice-to-have (later) |
|---|---|---|
| Local 1v1 (same keyboard / 2 gamepads) | ✅ | Online multiplayer |
| Single small arena | ✅ | Multiple stages / hazards |
| Four core animations: idle, walk, light punch, heavy kick | ✅ | Combos, throws |
| Health bar & win/lose UI | ✅ | Character select, pause menu |
| Simple hit-box collider system | ✅ | Frame-data editor, hit-stun |
| Basic AI “dummy” | ✅ (optional) | Adaptive AI, difficulty levels |
| SFX placeholder + single looping track | ✅ | Dynamic soundtrack |
| Mobile / console build | ❌ | Later |
Assets/
Scenes/
Scripts/
Art/
Characters/
Animations/
FX/
Prefabs/
UI/
• Characters:
C# Script: FighterController.cs
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CharacterController))]
public class FighterController : MonoBehaviour
{
[Header("Movement")]
public float moveSpeed = 4f;
public Transform orientation; // empty child used to face opponent
[Header("Combat")]
public FighterCombat combat; // ref to combat component
public Animator anim;
private CharacterController cc;
private Vector2 moveInput;
void Awake(){
cc = GetComponent<CharacterController>();
}
// Input System callbacks
public void OnMove(InputAction.CallbackContext ctx) => moveInput = ctx.ReadValue<Vector2>();
public void OnLight(InputAction.CallbackContext ctx){ if(ctx.started) combat.DoAttack(AttackType.Light); }
public void OnHeavy(InputAction.CallbackContext ctx){ if(ctx.started) combat.DoAttack(AttackType.Heavy); }
void Update(){
Vector3 dir = new Vector3(moveInput.x, 0f, moveInput.y);
cc.Move(dir * moveSpeed * Time.deltaTime);
if(dir.magnitude > .1f) anim.SetBool("Walk", true);
else anim.SetBool("Walk", false);
// Always face opponent (orientation assigned at runtime)
transform.LookAt(new Vector3(orientation.position.x, transform.position.y, orientation.position.z));
}
}
Hook this up in the new Input Actions asset:
Action Map: Player
- Move (Vector2): WASD / Left Stick
- Light (Button) : J / X (pad)
- Heavy (Button) : K / Y (pad)
Duplicate for Player 2 with different bindings (Arrow keys / second gamepad).
C# Script: FighterCombat.cs
using UnityEngine;
public enum AttackType { Light, Heavy }
public class FighterCombat : MonoBehaviour
{
public int lightDamage = 5;
public int heavyDamage = 12;
public float attackRange = 1.2f;
public LayerMask opponentMask;
public Animator anim;
public FighterHealth health;
public void DoAttack(AttackType type){
anim.SetTrigger(type == AttackType.Light ? "Light" : "Heavy");
// Super naive hit-detection one frame later
Invoke(nameof(DetectHit), type == AttackType.Light ? .2f : .4f);
}
void DetectHit(){
Collider[] hits = Physics.OverlapSphere(transform.position + transform.forward * attackRange, 0.5f, opponentMask);
foreach(var hit in hits){
hit.GetComponent<FighterHealth>().TakeDamage(
hits.Length > 0 ? (int)(hit.GetComponent<FighterCombat>().heavyDamage) : lightDamage
);
}
}
}
C# Script: FighterHealth.cs
using UnityEngine;
using UnityEngine.UI;
public class FighterHealth : MonoBehaviour
{
public int maxHP = 100;
public Slider hpBar;
private int currentHP;
void Start(){
currentHP = maxHP;
hpBar.maxValue = maxHP;
hpBar.value = maxHP;
}
public void TakeDamage(int dmg){
currentHP -= dmg;
hpBar.value = currentHP;
if(currentHP <= 0) KO();
}
void KO(){
GetComponent<Animator>().SetTrigger("KO");
FindObjectOfType<GameManager>().AnnounceWin(gameObject.name == "Player1" ? "Player 2" : "Player 1");
}
}
public class GameManager : MonoBehaviour
{
public TMPro.TextMeshProUGUI winText;
public void AnnounceWin(string winner){
winText.gameObject.SetActive(true);
winText.text = winner + " wins!";
Time.timeScale = 0; // pause
}
}
Attach it to an empty GameManager in the scene; reference TMP text in Canvas.
Spawn1, Spawn2) opposite sides of arena.Animator with a simple Animator Controller (Blend Tree Walk; triggers Light, Heavy, KO)CharacterControllerFighterController, FighterCombat, FighterHealthStart(), assign each fighter’s orientation field to the other fighter’s transform so they auto-face.DummyAI.cs
public class DummyAI : MonoBehaviour
{
public FighterController ctrl;
public float thinkEvery = 1.2f;
void Start(){ InvokeRepeating(nameof(Think), 1f, thinkEvery); }
void Think(){
int r = Random.Range(0,3);
if(r==0) ctrl.combat.DoAttack(AttackType.Light);
else if(r==1) ctrl.combat.DoAttack(AttackType.Heavy);
// else stand still
}
}
Replace Player2’s controller component with DummyAI if you want single-player quick test.
Canvas (Screen Space-Overlay):
• Slider HP P1 top-left
• Slider HP P2 top-right (flip fill direction)
• Center TextMeshPro winText (hidden initially)
Add a small “Press R to Restart” tip—just call SceneManager.LoadScene(0) on key press.
CinemachineImpulse).AudioSource.PlayOneShot.PC build:
• Player1 – WASD / J / K
• Player2 – Arrow keys / Numpad 1 / Numpad 2
Gamepad (XInputs) auto-map via Input System.
Later: Export to WebGL for itch.io demo or build Android APK if you swap to on-screen buttons.
| Day / Hour | Task |
|---|---|
| Friday Night | Install Unity, set up repo, import assets (1 h) |
| Sat 10 AM – 1 PM | Implement Player Controller & Input (3 h) |
| Sat 2 PM – 5 PM | Combat scripts, animations hooked up (3 h) |
| Sat Evening | UI health bars + victory condition (1 h) |
| Sun Morning | AI dummy or 2-P controls (1 h) |
| Sun Afternoon | Polish: particles, audio, camera tweaks (2 h) |
| Sun Night | Playtest, fix bugs, package build (1 h) |
• Add combo chains & frame data tables
• Character selection & multiple models
• Networking (Unity Netcode, Photon)
• Advanced hit-box editor (Scriptable Objects)
• Ranking system, online leaderboards
FighterController & FighterCombat with sphere overlap for hits.You now have a bare-bones but fully playable 3-D fighter MVP—plenty to show stakeholders, friends, or players, and an ideal base to iterate upon. Have fun building, and may your frame data be ever in your favor! 💥