Files
tactical-shooter/client/template/scripts/Weapon_State_Machine/PickUp Weapons/reload_clip.gd
T
shawn ad48f38ca5 feat: integrate ChaffGames FPS template as local player controller
Replaces the overhead box-mesh view with a full FPS character:

- mouse look, WASD movement, jump (Space), crouch (C), sprint (Shift), lean (Q/E)

- 6 weapons (LMB shoot, R reload, scroll switch, F melee, G drop)

- Crosshair HUD, ammo counter, sprint bar

- Client sends position to server at 20Hz for multiplayer visibility

- Server broadcasts positions to all peers

- Remote players shown as boxes (placeholder)

source: https://godotengine.org/asset-library/asset/2652 (MIT license)
2026-07-02 00:26:45 -04:00

19 lines
390 B
GDScript

extends RigidBody3D
@export var _weapon_name: String
@export var _current_ammo: int
@export var _reserve_ammo: int
const TYPE = "Ammo"
var Pick_Up_Ready: bool = false
func _ready():
await get_tree().create_timer(2.0).timeout
Pick_Up_Ready = true
func Set_Ammo(w_name: String, c_ammo : int, r_ammo : int):
if w_name == _weapon_name:
_current_ammo = c_ammo
_reserve_ammo = r_ammo