Hello, again haha. I'm currently experiencing an issue where the game crashes with a breakpoint and I'm unsure what causes this. I am making a hurtbox/hitbox system and, at first, the game used to crash when I actually entered the hitbox of the enemy, but now it crashes every time I even open the project. I made an EnemyBase inhereted from an EntityBase, then added the following script to it:
extends KinematicBody2D
export(int) var hp_max: int = 100
export(int) var hp: int = hp_max
var velocity: Vector2 = Vector2.ZERO
export (int) var SPEED: int = 75
onready var animatedsprite = $AnimatedSprite
onready var collshape = $CollisionShape2D
func _physics_process(_delta):
move()
func move():
velocity = move_and_slide(velocity)
func die():
queue_free()
func _on_Hurtbox_area_entered(hitbox):
var base_damage = hitbox.damage
self.hp -= base_damage
print(hitbox.get_parent().name + "'s hotbox touched " + name + "'s hurtbox and dealt " + str(base_damage))
The Hitbox of the enemy just has the damage variable, this is Hitbox.gd:
extends Area2D
export(int) var damage: int = 10
Any ideas on how to fix this?