Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Jack J |
I just made the first game in the Godot: Sam’s Teach Yourself book, and to all appearances everything works great, but Godot still reports an error:
ERROR: emit_signal: Error calling method from signal 'timeout': 'Node2D(stage.gd)::_on_spawnTimer_timout': Method not found.
In this error timeout is spelled incorrectly, but I do not believe I have done this myself. The Timer named spawnTimer is connected with a correct spelling, and the function within the Node2D which it connects to is also spelled correctly. The code initiated by the spawnTimer timeout also operates as intended, so I don’t really know what is causing the error. The only incorrect spelling I can find is coming from the debugger.
func _on_spawnTimer_timeout():
var asteroidInstance = asteroid.instance()
asteroidInstance.position = Vector2(SCREEN_WIDTH + 8, rand_range(0, SCREEN_HEIGHT))
asteroidInstance.connect("score", self, "_on_player_score")
asteroidInstance.moveSpeed += score
add_child(asteroidInstance)
$spawnTimer.wait_time *= .99
This is why I hate things being so string based. Out of curiosity try doing a global search of all your project’s files for “timout”. And maybe provide the code that does the connect.
duke_meister | 2018-07-10 01:07
How is a global search in Godot performed?
Jack J | 2018-07-10 03:30