crystal-bit / godot-game-template

Generic template for Godot games
MIT License
620 stars 48 forks source link

fix "Play Scene" compatibility #100

Closed jrassa closed 3 weeks ago

jrassa commented 3 weeks ago

When launching a scene directly using "Play Scene", an error will occur if you try to access an @onready variable from pre_start or start.

Updated scenes.gd to ensure the scene is ready before calling pre_start and start. Updated gameplay.gd to use @onready variable to highlight the bug and fix.

davcri commented 3 weeks ago

Hi @jrassa thanks for the PR! I didn't know about is_node_ready(), pretty useful.