need help with enemy collision

Godot Version

Godot 4.3

Question

Ive been following this guide to a t but for some reason i cant get player to register getting hurt at all! the game runs fine but i get this error while running it

image

heres the code the errors calling to

class_name HitBox extends Area2D

signal damaged( hurt_box : HurtBox )




func _ready() -> void:
	pass 



func TakeDamage( hurt_box : HurtBox ) -> void:
	damaged.emit( hurt_box )

Show your plant.gd script.

As @wchc said, it would be easier to help you if you showed plant.gd, though I think you also need to show the HurtBox class. I have no inclination to watch a 40 minute video just to get that info.

That being said, it certainly seems like the root issue is plant.TakeDamage is expecting an int as an argument and you are passing it a HurtBox. You need to modify the method to take the argument type passed into it and extract whatever int you need from the HurtBox object.

As others have said we need more code. The error seems to be calling towards you trying to convert an object to an integer. But that’s just me reading the image on my small phone screen.