TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
355 stars 18 forks source link

Fix not in tree startup errors #150

Closed TheDuckCow closed 8 months ago

TheDuckCow commented 8 months ago

Fixing the primary cause of startup console errors if multiple scenes open.

Before this change we could get many errors on startup if we had multiple startup scenes auto-opened with road generator usage. For any scene other that the one which is set to active, we'd get these slew of errors:

Cannot get path of node as it is not in a scene tree.
scene/3d/spatial.cpp:407 - Condition "!is_inside_tree()" is true. Returned: Transform()

These were hard to debug initially since it gives no culprit line outputs, and may be an issue very unique to the editor. But the scene check is a safer one anyways for rebuild segments worth keeping for production builds too. Need to test exported project still work with this.