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)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
extends Projectile
|
||||
|
||||
@export var explosion: ShapeCast3D
|
||||
|
||||
func _on_body_entered(_body, _proj, _norm):
|
||||
var collision_location: Vector3 = _proj.global_position
|
||||
explosion.global_position = collision_location
|
||||
|
||||
explosion.force_shapecast_update()
|
||||
var targets = explosion.get_collision_count()
|
||||
|
||||
for t in targets:
|
||||
var damage_target = explosion.get_collider(t)
|
||||
var collision_point: Vector3 = explosion.get_collision_point(t)
|
||||
var collision_normal: Vector3 = explosion.get_collision_normal(t)
|
||||
var hit_scan_array = [damage_target,collision_point,collision_normal]
|
||||
Hit_Scan_Collision(hit_scan_array,damage,collision_location)
|
||||
|
||||
_proj.queue_free()
|
||||
Projectiles_Spawned.erase(_proj)
|
||||
|
||||
if Projectiles_Spawned.is_empty():
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user