Skip to content

FireBullet3D #1980

@pokeunite

Description

@pokeunite

Description

A comprehensive "Plug-and-Play" weapon system for 3D FPS and TPS games. This extension bridges the gap between 2D UI (Crosshairs) and 3D World Space.

Key Features:

  • Hybrid Architecture: Supports both Physical Projectiles (Bullets/Rockets) and Hitscan (Instant Lasers/Snipers).
  • Smart-Aim System: Uses Normalized Device Coordinates (NDC) to calculate the exact vector from the camera through the 2D crosshair. This fixes parallax errors and ensures 100% accuracy regardless of screen resolution or aspect ratio.
  • Physics Integration: Includes a custom "Gravity Scale" property, allowing specific weapons (like Snipers) to have low bullet drop while others (Grenades) have high drop, independent of global gravity.
  • Robust Ammo Cycle: Manages Clip Size, Current Ammo, Reserve Ammo, and Auto-Reload logic.
  • Time-Scale Safe: All timers (Fire Rate, Reload) use the Scene Time Manager, ensuring weapons pause correctly when the game is paused or in slow-motion.

How to use the extension

  1. Setup: Add the Firebullet3D behavior to your Gun object.
  2. Properties: Configure your Clip Size, Fire Rate, and Gravity Scale (0 = Straight flying, 1 = Normal physics drop).
  3. Logic:
    • Use the condition "Is Gun Ready To Fire?" to check cooldowns and ammo.
    • Use the action "Spawn Bullet" or "Shoot Hitscan Ray".
    • Important: Drag your UI Crosshair object into the "Crosshair" parameter of these actions to enable the Smart-Aim accuracy.
  4. Reloading: Use the "Reload Gun" action to trigger the reload timer.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

Example file

gdevelop-game.zip

Extension file

FireBullet3D.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions