+3 votes

Hello and thank you in advance to anyone who will share his/her opinion.
I would like to simulate a one way monorail system as per the below schematics.
My approach would be to define 9 path2ds and then - using a reparenting of the Pathfollow2d - I would move the vehicle from the current path to the one connecting to the desired arrival Station.

monorail system schematics

At the moment I have only set up 2 paths and I am only able to move a vehicle from Station A path2d 2 to the Main track path2d 1 via reparenting.
I can not figure out - as an example - how to instruct the vehicle to move from the Main track path2d 1 to the arrival exit track (e.g. Station C path2d 5).
In the final project I would like to have a setup as the above picture and a simple GUi, as per the below picture:
simple gui
I would love to read your suggestions on the following topics:

  1. How would you approach the matter of coding - in Godot - the described system.
  2. If you agree on using multiple 2dPaths and how you would tackle the "exit at Station X" issue
  3. In which way is created - in Godot - a "Station" Object, e.g. an object which stores each station information (name, number of available vehicles currently at the station) and a "Vehicle" Object, e.g. an object which stores each vehicle information (vehicle id, current path, current station, current x, current y).

Thank you for reading, any comment will be highly appreciated.

Giovanni

in Engine by (22 points)
edited by

The reddit user Arigoru posted his approach to the question here: reddit link alongside a demo video.
Thank you Arigoru!

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.