bug in a early prototype

Godot Version

4.4

Question

`im trying to make it so that if mouse is hover over the collsion and the mouse clicks then print text

func _on_collision_attack_mouse_entered() → void:
print(“mouseEneteredHiTCOLL”)
if Input.is_action_just_pressed(“Punching”):
print(“MouseClicked”)`

What did you expect to happen and what really happened? what’s the bug?

If you do happen to see the first print then I’m betting you won’t see the second, your function only runs on the frame the mouse enters the area, so you are also only checking if Input.is_action_just_pressed on that same frame. You need a seperate Input function to detect both these events, the mouse entering and the button being pressed.

Also, I don’t know if this is a cop/paste issue, but your function body is not indented

1 Like