Heyo,
I have a bit of code below. I'm getting this error (E 0:00:08:0987 emit_signalp: Error calling from signal 'area_shape_entered' to callable: 'CharacterBody2D(Player.gd)::_on_player_face_collider_a_2d_area_shape_entered': Method expected 0 arguments, but called with 4.)
I don't understand why it's being called with 4.
Maybe I don't understand how the built-in signals work exactly in the first place.
All I know is that every answer sounds like "It's calling an argument because you have one", or "Just use a stand-in parameter like _DoesNothing", which does nothing.
Any help is of course appreciated.

func _on_player_face_collider_a_2d_area_shape_entered(area):

	## SET FACE COLLIDER VARIABLES ##
FaceColliderOverlap = true
FaceColliderArea = area.get_groups()

	## WHEN PLAYER THROWS SMALL OBJECT, THE INSTANCED NODE WILL USE THIS VARIABLE ##
MainGlobalScript.CurrectSmallObjectArray = area.get_groups()`

Thank you

  • Here's the documentation for the signal area_shape_entered:
    https://docs.godotengine.org/en/4.1/classes/class_area2d.html#signals

    As you can see, it has four arguments:

    area_shape_entered ( RID area_rid, Area2D area, int area_shape_index, int local_shape_index )

    In your code, change:
    func _on_player_face_collider_a_2d_area_shape_entered(area):
    to:
    func _on_player_face_collider_a_2d_area_shape_entered(area_rid: RID, area: Area2D, area_shape_index: int, local_shape_index: int):

    You don't have to use all the arguments in the function body, but they have to be present in the function header.

Here's the documentation for the signal area_shape_entered:
https://docs.godotengine.org/en/4.1/classes/class_area2d.html#signals

As you can see, it has four arguments:

area_shape_entered ( RID area_rid, Area2D area, int area_shape_index, int local_shape_index )

In your code, change:
func _on_player_face_collider_a_2d_area_shape_entered(area):
to:
func _on_player_face_collider_a_2d_area_shape_entered(area_rid: RID, area: Area2D, area_shape_index: int, local_shape_index: int):

You don't have to use all the arguments in the function body, but they have to be present in the function header.

    7 days later

    DaveTheCoder
    Thank you!
    Interesting, I wonder if Godot 4 added more accessible arguments to the built-in function or if it just now requires more meticulous information.

    For that signal, Godot 3 also has four arguments.