Using Configurable Joints to Make Train Couplers in Unity

Поділитися
Вставка
  • Опубліковано 11 чер 2024
  • Hey Everyone! Here's a quick tutorial on how to setup configurable joints in such a way to make them act like train couplers. I hope you find it helpful!
    This is a follow up to a video on making physics based spline movement where I also implemented a train, but the joints in that video were pretty atrocious. Do these joints instead, they are much better. The physics stuff in that video was pretty solid though and that's the foundation I'm using here. Please ignore the poor production quality of that video if you do watch it, each one is getting better :)
    If you'd like to support me making these videos, this is a great place to do so :)
    ko-fi.com/paridot
    Spline Train Physics Video: • Making a Spline Train ...
    Configurable Joint Docs: docs.unity3d.com/Manual/class...
    Configurable Joint API: docs.unity3d.com/ScriptRefere...
    Timestamps:
    0:00 - Intro
    0:43 - Joint Requirements
    1:59 - Joint Setup
    GitHub Repository:
    github.com/Paridot/YT_Physics...
    Join our Discord Server!
    / discord
    Wishlist our game RUIN!
    store.steampowered.com/app/25...
    Music Credit:
    "Odyssey" Kevin MacLeod (incompetech.com)
    Licensed under Creative Commons: By Attribution 4.0 License
    creativecommons.org/licenses/b...

КОМЕНТАРІ • 19

  • @mikkelens
    @mikkelens Рік тому +3

    I watched that original video with amazement on how you would trust rigidbodies to work properly as joints on their own, and this video is a great relief in that I now know I wasn't losing my mind when I thought about the joint components in the original video. I've been experimenting with all the types of joints for a VR game recently and I can't explain how nice it feels to see someone else use it for an actual usecase and not just a tutorial with no motivated use case.

    • @paridotgames
      @paridotgames  Рік тому

      I very quickly realized after that video that I made a mistake lol - they would constantly get detached for seemingly no reason or bug out and over collide with each other, not to mention the frame loss with anymore than about 15 carts.
      I'm curious what kind of stuff you are using joints for. It was really cool playing around with configurable joints for an actual project, but it is kind of hard to imagine using configurable joints to their full capabilities. I'd love to see some more use cases for them though

  • @TrentSterling
    @TrentSterling 7 місяців тому +1

    Hey I reference the original rigidbody splines video often. For VR this kind of movement is very important. Didn't know there was a followup! Very cool

  • @lee1davis1
    @lee1davis1 Рік тому

    Thanks for giving us an update. I used your first vid to help me setup my train. I really appreciated your help.

  • @brianwilson7497
    @brianwilson7497 3 місяці тому

    these are so good man thanks for sharing

  • @jhsua
    @jhsua Рік тому +1

    as usual Great JOB!

  • @Binoxo
    @Binoxo Рік тому

    thank you for this, will u be corver/Know any resorces regarding spline junctions?

  • @mariegrasmeier9499
    @mariegrasmeier9499 Рік тому +1

    Hey, nice video, thanks. I wonder if you plan to build in the option to couple and decouple the cars during runtime. If so, I would be super interested in how you do this

    • @paridotgames
      @paridotgames  Рік тому +1

      Thanks for watching - and I think this would be a really cool addition! First thought that comes to mind about how I'd approach it would be to just remove or add the connected body of the joint based on whatever coupling/decoupling parameters you have - or even easier, just disabling/enabling the joint for that cart. There could be a collision detection that enables the joint, and a button for decoupling that disables the joint. This is just initial thoughts so I may be completely out to lunch on that lol.
      This is mostly a side project that I do if I have free time, so nothing planned yet, but this is now a contender for the next step in the project!

    • @mariegrasmeier9499
      @mariegrasmeier9499 Рік тому

      @@paridotgames Thank you for your answer. I once tried the approach you suggested but found that it was not possible to enable/disable joints 😞. I then gave up and did not follow up on that (did a silly workaround then for my project with setting the connected object kinematic and copying the position of the other transform, thus sacrificing any physics in the connection for the time being). Will try again when I have time and need it again.

  • @stzyotuber
    @stzyotuber 2 місяці тому

    Bro make mobile ui for railroad v3 assets train controller Please 🙏

  • @HansPeter-gx9ew
    @HansPeter-gx9ew Рік тому +1

    Nice content! But please make the volume up and less local vocal fry, I just hear RRRRRRRR

    • @paridotgames
      @paridotgames  Рік тому +1

      Lol it’s surprisingly hard to kick but I’m working on it! Thanks for the feedback :)

    • @HansPeter-gx9ew
      @HansPeter-gx9ew Рік тому +1

      @@paridotgames After reading my comment again I sounded maybe toxic D: ; not meant like that you helped me understand config joints finally.
      Most valued thing you said is that the axis regards to the local axis of the Gameobject the Config Joint is attached too (not the other Object's space, not global space etc.)
      Cheers!

    • @tommytestpilot5733
      @tommytestpilot5733 10 місяців тому

      @@HansPeter-gx9ew It sounded like genuine feedback. If there is a problem that reduces the value of problem solving/solutions, then giving that kind of feedback helps everyone in their understanding and enjoyment of the subject.

  • @moneymine1
    @moneymine1 Рік тому +1

    didnt consult me about trains, didnt learn