Closed TheDuckCow closed 1 year ago
Reframing this task to be more about addressing startup issues, such as warnings and errors on open.
On further exploration, it seems to be happening due to a variety of reasons:
on_transform
in the RoadPoint class.setget
necessarily being called (possibly twice) on scene load. See https://github.com/godotengine/godot/issues/17436
for more details). global_transform
is called).While working on resolving the warnings, I may have actually eliminated the issue referenced here: https://github.com/TheDuckCow/godot-road-generator/issues/3
Once I added flags of:
if not is_instance_valid(network):
return # might not be initialized yet
to the RoadPoint class, it seemed to resolve point number 3.
Fixed with the above changes.
Sometimes while moving RoadPoints, there is a bad state where geometry doesn't update, and we get errors like:
res://addons/road-generator/road_network.gd:142 - Invalid set index 'low_poly' (on base: 'null instance') with value of type 'bool'.
My hunch is this is something to do with how the scene-tree initializes, but that would need further verification. When I faced this in the demo project and I opened a new scene and created a network from scratch (using spatials), I did not run into this issue.
Also unsure if related, but occasionally get the error:
res://addons/road-generator/plugin.gd:33 - Attempt to call function 'hide_gizmo' in base 'null instance' on a null instance.
Which again points towards a reference / initialization error, or at least an issue with the plugin's ability to correctly pick up the current state when being triggered to make a change.