WIP: Currently I'm not sure how to do it

This commit is contained in:
2025-01-26 14:39:11 +01:00
parent 7da4a3d6bb
commit adce112be9
7 changed files with 54 additions and 8 deletions

View File

@ -1,8 +1,11 @@
extends Node3D
var owner_placeholder: CharacterBody3D = null
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
print("ready")
owner_placeholder = _get_owner()
pass # Replace with function body.
@ -12,5 +15,12 @@ func _process(delta: float) -> void:
func _on_head_collision_body_part_hit(dam: Variant) -> void:
print("head is hit")
print("head is hit" + str(dam))
owner_placeholder.take_damage(dam)
pass # Replace with function body.
func _get_owner() -> CharacterBody3D:
var owner_placeholder := find_parent("CharacterPlaceholder")
return owner_placeholder

View File

@ -4,10 +4,10 @@ extends Area3D
signal body_part_hit(dam)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass