Forum rules - please read before posting.

Draggable & Tracks

Hello,

I'm developing a 2D maze minigame where the player needs to drag an icon through a maze to find an exit. I'm using the 'Draggable' component along with multiple 'Straight Tracks' to create the maze pathways (https://imgur.com/a/UvY1A51 as shown in the attached image, where the red dot represents the draggable icon that should follow the black paths).

However, I'm encountering difficulties when trying to connect multiple 'Straight Tracks' together. For instance, I attempted to link StraightTrack1 to StraightTrack2 (by setting StraightTrack1's 'Connected track 0' to StraightTrack2 and vice versa), but this doesn't seem to work as expected.

Could anyone provide guidance on how to properly connect multiple tracks so that the draggable icon can move smoothly throughout the entire maze? Any advice or directions would be immensely helpful.

Thank you very much!

Comments

  • What's the specific issue you're having?

    If you want the red dot to be moveable both back and forth between the tracks, you'll need to set up the "Connected track" fields on both.

    Make sure that the "Centre position" is correct on each. If the top-most track is pointing down, for example, this position will be 1.

    I'd recommend starting with a more simple design while testing - start with just a couple of tracks/lines and get that working first.

    The Chamber Demo makes use of this technique for the "Strange device" item puzzle on the table. You can examine its setup by grabbing the package from the Downloads page, importing into a fresh project, and opening up the CloseUp_UnassembledKey prefab.

  • Thank you so much for your help!

    I had misunderstood the purpose of the "Center position." After adjusting the values as you suggested, the tracks are now functioning correctly, and the red dot can move back and forth between them without any issues (previously, only the first track worked). Thanks again for the link to the Chamber Demo.

  • Sorry for asking another question. It worked well when the tracks were perpendicular to each other, but it doesn't seem to work when the tracks are aligned. For instance (https://imgur.com/a/PWPpCjQ), if there are two vertical tracks and I place them end-to-end, the draggable object doesn't continue to move onto the next track. Am I missing anything?

  • You don't need to place two tracks end-to-end like that - a single track spanning the full length will do it.

    If the curved line at the intersection is another track to connect to, you can create a connection point around halfway along the single straight track.

  • Thank you for the clarification! I understand now. I had planned to disconnect and reconnect the tracks based on the player's decision, but it seems I'll need to find a different approach. Thanks again. Have a wonderful weekend :smile:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.