WIP: Currently I'm not sure how to do it
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user