Unsafe shootage

This commit is contained in:
Rendo 2025-11-24 05:25:31 +05:00
commit a046ae5288
8 changed files with 27 additions and 2 deletions

View file

@ -0,0 +1 @@
extends Node

View file

@ -0,0 +1 @@
uid://djmsesf818ovp

View file

@ -1,5 +1,7 @@
extends CharacterBody3D
class_name Player
const MAX_HP = 100
@export var hp: int = 100:

View file

@ -0,0 +1,5 @@
extends RayCast3D
func _ready() -> void:
add_exception($"../..")

View file

@ -0,0 +1 @@
uid://6c14qse4vnra

View file

@ -9,6 +9,8 @@ extends Usable
@export var prefix: String
@export var raycast: RayCast3D
var ammo_amount: int
var fire_timer: Timer
@ -43,6 +45,10 @@ func fire() -> void:
system.animation_player.stop()
system.animation_player.play(prefix+"_shoot")
system.animation_player.queue(prefix+"_idle")
if raycast.is_colliding():
raycast.get_collider().hp -= damage
func alternate_state() -> void:
pass