E 0:00:25:0888 ladder_event_1.gd:16 @ _process(): Error calling from signal 'body_entered' to callable: 'Area2D(ladder_event_1.gd)::_on_body_entered': Method expected 1 arguments, but called with 0.
<Исходный код C++>core/object/object.cpp:1140 @ emit_signalp()
<Трассировка стека>ladder_event_1.gd:16 @ _process()
it works as intended but i wonder why it gives mistake
mistake happens with both “body_entered” and “body_exited” signals
the problem might be with body, what is the body variable? the error is saying that you are calling the function that requires a argument but you arent giving it a argument. the “body” variable should be the collision shape
E 0:00:03:0744 ladder_event_1.gd:7 @ _on_body_entered(): Error calling from signal 'body_entered' to callable: 'Area2D(ladder_event_1.gd)::_on_body_entered': Method expected 1 arguments, but called with 0.
<Исходный код C++>core/object/object.cpp:1140 @ emit_signalp()
<Трассировка стека>ladder_event_1.gd:7 @ _on_body_entered()
E 0:00:01:0858 ladder_event_1.gd:7 @ _on_body_entered(): Error calling from signal 'body_entered' to callable: 'Node2D(inventory.gd)::ladder_event_1_entered': Method expected 1 arguments, but called with 0.
<Исходный код C++>core/object/object.cpp:1140 @ emit_signalp()
<Трассировка стека>ladder_event_1.gd:7 @ _on_body_entered()
Ah the real issue is you are emitting signals yourself, do not do this as body_entered and body_exited already emit when something enters, that’s how your “ladder_event_1.gd” script is working, notice the error points out “_on_body_entered called with zero arguments”? The engine is getting terribly confused because this signal is being handled with body in ladder_event.gd but emitted without body, in your inventory.gd you connect to the same erroneous signal.
I would remove this entire script, or you can change it to emit the signal you created rather than try to emit signals that already exist.
extends Area2D
signal entered_area
func _on_body_entered(body) -> void:
if body.name == "ryuji":
entered_area.emit()