Godot Version : 4.6
So I am working on a management sim and I was wondering how would I go about creating a hallway tool similar to how the road tool works in the Sim City games and City Skylines games (click on the tool, the left click somewhere on the map and while holding left click drag it in any direction to make a hallway). The way my building system works is that you have pre-made rooms you can place on a 2 by 2 grid (Vector3 2,1,2) but to place them they need to be connected to a hallway which can be created by click the tool and then left click hold and drag in any direction (with then some advance stuff added in once I’ve gotten the base system in, which is what I’m currently trying to figure out). So I need to figure out whats the best way to set up the drag system, that allows for hallways to be made but can also connect to other already existing hallways and have the doorways appear for when a room is connected to that hallway.
How would you expect an answer to such a broad question to look like?
1 Like
You can consider it to not be hold and drag. Just have the preview when you hover the area imo. You would be skilled enough to immediately be decisive and plant down a room or hallway. But the average player for these sort of games are often casual players who keep backtracking and second guessing even as they move the mouse. So asking them to click and hold and drag could be a source of friction. Or is there some mechanics that require it?
The preview only way is I think much easier to code also since you’re just having a simple toggle whether in variable or if you want to go the enum route, that also works. You don’t have to query if the user is holding down the left click. These sort of holding actions can be quite tricky sometimes.
1 Like
Honestly that’s not a bad idea, I had a system set up like that in s&box when I was originally setting up the game there so I could port that over.