ad48f38ca5
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)
16 lines
615 B
GDScript
16 lines
615 B
GDScript
extends Projectile
|
|
|
|
@onready var melee_hitbox: ShapeCast3D = $MeleeHitbox
|
|
|
|
func _over_ride_collision(_camera_collision:Array, _damage: float):
|
|
melee_hitbox.force_shapecast_update()
|
|
var colliders = melee_hitbox.get_collision_count()
|
|
for c in colliders:
|
|
var Target = melee_hitbox.get_collider(c)
|
|
if Target.is_in_group("Target") and Target.has_method("Hit_Successful"):
|
|
Hit_Successfull.emit()
|
|
var Direction = (Target.global_transform.origin - global_transform.origin).normalized()
|
|
var Position = melee_hitbox.get_collision_point(c)
|
|
Target.Hit_Successful(_damage, Direction, Position)
|
|
queue_free()
|