raycast now does not pierce walls

This commit is contained in:
Rendo 2025-11-27 11:49:33 +05:00
commit 388fe1ccce
3 changed files with 8 additions and 3 deletions

View file

@ -3,3 +3,10 @@ extends RayCast3D
func _ready() -> void:
add_exception($"../..")
func try_deal_damage(damage) -> void:
if is_colliding() == false:
return
var collider = get_collider()
if collider is Player:
collider.hp -= damage