[게임개발자] 레드핑
Godot weapon GDscript 본문
Godot Weapon.gd
가 필요
extends Node2D
var attack_dmg :=10.0
# Called when the node enters the scene tree for the first time.
func _on_hitbox_area_entered(area):
if area.has_method("damage"):
var attack = Attack.new()
attack.attack_damage = attack_dmg
area.damage(attack)
What is has_method
?
직접 참조보다는 느리지만, 해당 인자를 String 으로 받아서 찾아주는 함수.
'일상 > 개발일상' 카테고리의 다른 글
개발 지금 상황 (0) | 2023.10.31 |
---|---|
Godot Attack component 만든후 문제 (0) | 2023.10.16 |
Godot hitboxComponent (0) | 2023.10.12 |
Godot Attack 만드는법 (2) (0) | 2023.10.11 |
Godot Attack 만드는법 (0) | 2023.10.10 |