TheDuckCow / godot-road-generator

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

Can't click to select in Godot 4 with no initial selection #151

Open TheDuckCow opened 8 months ago

TheDuckCow commented 8 months ago

We have a problem in the Godot 4 port of the Road Generator: You can only click to select a RoadPoint if you have some node already selected in the hierarchy view (regardless of whether it is a node from the plugin).

Per conversation here, one option is insert a control node over the specific 3d viewport to handle clicks. We'd need to handle scenarios like camera live view and quad view, inserting control nodes for each.

Another option would be to avoid custom selection handling altogether, as it already is itself a bit hacky. Instead of a click selecting the nearest selected RoadPoint and immediately changing the selection as a result (current day in Godot 3.5), it would instead select the parent roadpoint. With this approach, we can just use the collision mesh of the road segment directly as part of the node's collision mesh, and let Godot handle the rest natively.

This seems like a much nicer experience in the end, and reinforces that the segment you click on will inherit some settings (such as whether to draw geo or not) from the direct parent RoadPoint. It does mean click just to the left or right of a RoadPoint indicator int he 3D scene will result in different resultant selections, which could be annoying (and why we designed it the way it is today). We could always increase the size of the blue indicator of the roadpoint itself so it's easier to actually use for selection directly.