TheDuckCow / godot-road-generator

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

Workaround for godot empty array synced bug #86

Closed TheDuckCow closed 1 year ago

TheDuckCow commented 1 year ago

There are some cases where I've noticed that somehow the export variable of one RoadPoint is somehow synced with that of another, even though they are distinct instances. This twitter post seems to have run into the same situation, and found an intersting workaround: (subbing in the offending variable name in RoadPoint)

export var traffic_dir:Array = []
func _init():
    traffic_dir = []  # clear the reference.

This does not seem to be an issue in Godot 4, so we would not need to keep this fix in Godot 3.5 if we do make this change.

Recording of the specific error in question:

https://user-images.githubusercontent.com/2958461/229102603-dedc8f96-313f-4c61-8f6c-ec894d31c6e7.mp4

TheDuckCow commented 1 year ago

Closing this as the bug has been resolved for a little while now (per PR).