v0.0.3

168 lines of code generated.

Today I’ve been working on the shoot logic for the game, added an AI generated 3D pistol, and a simple UI.

The Player shooting script handles a pistol-style weapon. It manages firing, reloading, recoil, bullet holes, sound effects, and UI updates.

Key Features:

  1. Shooting Mechanic:
    • Fires a raycast from the player’s camera.
    • Reduces ammo with each shot.
    • Plays a shooting sound.
    • Applies random recoil spread to shots.
    • Spawns bullet hole decals on surfaces.
    • Deals damage to objects that implement the IDamageable interface.
  2. Ammo & Reloading System:
    • Stores current ammo, magazine size, and reserve ammo.
    • Pressing “R” (or when empty) triggers a reload coroutine.
    • Plays a reload sound and refills the magazine from reserve ammo.
  3. Recoil System:
    • Each shot increases recoil, affecting bullet spread.
    • Recoil gradually decays over time.
  4. UI Updates:
    • Updates ammo display using TextMesh Pro.
  5. Sound Effects:
    • Uses an AudioSource to play shooting & reloading sounds.

Leave a Reply

Your email address will not be published. Required fields are marked *