The collisionshape2D is not working

`Godot 4.3

hi it’s been the whole day that im trying to fix this problem. basically the input of area2D “on_body entered” is not working. I tried everything but nothing. I attach some photo of tree, coding and scene. I can surely say that it’s not a problem of the changescheme, as it work in the other scene.

[grid]

Did you set any collision layers or masks? Can you describe what you expect to happen vs what really happens?

1 Like

The Area2D.body_entered signal expects an argument in the callback. func _on_body_entered(body:Node2D) -> void: for example.

You should be getting an error in the Debugger tab. Something like:

E 0:00:01:206   emit_signalp: Error calling from signal 'body_entered' to callable: 'Node::_on_area_2d_body_entered': Method expected 0 arguments, but called with 1.
  <C++ Source>  core/object/object.cpp:1249 @ emit_signalp()
2 Likes

yes i set the mask at 2, where the character is. the thing that should happen is that the player should exit the area changing scene (from that area to another)

im new about the programming stuff, what the callback is? if it’s the thing inside the parenthesis i already tried writing “body: Node2D” or “body: CharacterBody2D”

Can you share what appears in your output or stack trace panel when you do add body: Node2D? the callback is the connected function, of which requires the same parameters as the signal emits, in this case Area2D’s body_entered signal emits a body of type Node2D.

Could you screenshot the player’s collision layers & mask, and the Area2D’s layers & masks

1 Like

hey thank for the tips you gave me, I resolved the problem