How to make a pipe system for my 2D game?

Hello,
I want to add a system to my top down, 2D game, where an item can be put into a pipe, and travel along the length of it. However, I want the player to be able to build the pipe system using a series of pipe pieces that will fit together (like in Roller Coaster Tycoon). My idea I have had for doing this is to connect the path2Ds in each pipe segment together dynamically somehow, but I don’t know how to do that. Any tips on connecting the path2Ds, or for a different system are greatly appreciated.
Thanks in advance!

i guess the pipes should only save their positions and you create another class that holds all the connected pipes and creates a path out of it

Use TileMapLayer and set_cells_terrain_connect to create pipes system

I haven’t seen this before - could you expand a bit more on how it works please?

here’s a demo:

Run project
Left-click to place
right-click to remove

1 Like

Thank yo so much, this is great!