|Topic was automatically imported from the old Question2Answer platform.
So I’m new to Godot, been following a tutorial on YouTube making a Mario like 2D game. Been following along with no issues until it gets to the enemy stomp portion of the design. Instead of “killing” the enemy, my debug screen crashes despite having everything like the gentleman does in the tutorial thus far. It’s saying that the error is in the signal that was created for the stomp feature. I did have one other issue where it wasn’t registering the code for the signal correctly but fortunately was able to fix that bug. But now the issue is that when the player character stomps on the enemy character instead of “killing” it and ending it’s function on the screen it just closes the window and throws the error in the StompDection line of code set for the parameters of “killing” the enemy.
So the code for the signal is placed between the ready function and the physics process and looks like this.
func _on_StompDetector_body_entered(body: Node) -> void:
if body.global_position.y > get_node("StompDetector").global_position.y:
get_node("CollisionShaped2D").disabled = true
I’ve tried disconnecting and reconnecting the signal to see if that would resolve the issue but still nothing, and like I’ve said before this is the exact coding that the tutorial was showing and it was working for the instructor but not for me. I’ve even tried changing where (body: Node) is to (body: PhysicsBody2D) with the same result.So I don’t know if it’s me or if I’m missing something somewhere else. Please be kind as I’m still learning this platform and how to also input the proper information to get the desired results. If more information is needed to help with resolving this don’t hesitate to ask. Thank you.
It’s saying that the error is in the signal that was created for the stomp feature.
Could you show us the exact error the editor prints out?
Ertain | 2020-08-30 18:03