Grindable Rails In Unity Using The Spline Tool - Tutorial

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • A tutorial explaining how I do grindable rails in Unity.
    GitHub page for project files: github.com/SGT...
    ---
    My blog: adamluttonblog....
    Itch.io: sgtadman.itch.io/
    Twitch: / sgtadman
    Ko-Fi: ko-fi.com/sgta...

КОМЕНТАРІ • 16

  • @saltyyy5765
    @saltyyy5765 6 місяців тому +2

    Camera may be jittery in your part but if you add sparks behind the player it kinda looks good with the jitters

  • @echo7project904
    @echo7project904 7 місяців тому

    Definitely gonna take a look at this for my next project. Its arcady but it works for a idea i have.
    Thanks though ive been looking for some kind of tutorial on this.

  • @minimastudios_
    @minimastudios_ 8 місяців тому +1

    Thanks! Would donate but no donate button. Also, i originally had a physics checksphere for detecting rails, im not using chracter controller, any idea how to get specific rail info from that or am i forced to use ontriggerenter?

    • @minimastudios_
      @minimastudios_ 8 місяців тому

      Nevermind, man its late. im dumb for not just remembering i can use physics.spherecast

    • @adamlutton_gamedev
      @adamlutton_gamedev  8 місяців тому

      ​ @minimastudios_ That would work. I use the character controller collision method here, but would use OnCollisionEnter for a more generic type. But spherecasting will work as well. I actually use it in a game I'm working on for jumping between rails.
      Also, you can donate at the Ko-Fi link in the description. I very much appreciate it. Good luck with whatever you're working on.

    • @minimastudios_
      @minimastudios_ 8 місяців тому

      @@adamlutton_gamedev thanks! Got it all up and running. Changed the normalDIr to work off my orientation instead of the transform and added some lerp. It’s first person and it works smoothly! Had a hiccup since I’m using forces, jumping and turning off kinematic were too close together + switching right back to grinding immediately after jumping so when I call my version of getting off the rail I set the location of the player slightly above the rail. If you have a discord would be happy to share the results. I’ll check out the kofi too thanks

  • @zmaxer01
    @zmaxer01 Місяць тому

    Thx a lot been trying for a while now, this is a good solution 🎉

  • @polarstarcohhee
    @polarstarcohhee 9 місяців тому

    Excellent work! Can I take inspiration from your scripts here for me and my team's capstone project? I've been trying to make a mechanic similar to rail grinding, but been having trouble thinking around how it can work 😭

    • @adamlutton_gamedev
      @adamlutton_gamedev  9 місяців тому +1

      Go for it. There's a GitHub link to the project files in the description.

  • @xRaybeesx
    @xRaybeesx 8 місяців тому

    I am having a problem getting the direction to work, I use as sphere with a rigidbody to control my player that handles the physics so I dont think Unity understands the playerForward, when I hit the rail I am going a random direction, and don't rotate to the rail. Would you have any idea how to fix this?

    • @xRaybeesx
      @xRaybeesx 8 місяців тому

      The transform.rotation lines during MovePlayerAlongRail() dont seem to be actually working I dont think it's possible to rotate rigidbodys like that

    • @adamlutton_gamedev
      @adamlutton_gamedev  8 місяців тому

      It's not easy for me to comment specifically what's wrong without seeing the code. But I will ask if you're making sure the rigidbody is kinematic when it hits the rail? Otherwise, the physics will cause issues.

    • @adamlutton_gamedev
      @adamlutton_gamedev  8 місяців тому

      Wait, I do mention in the video that I'm using a character controller rather than a standard rigidbody, and mention that you need to use OnCollisionEnter instead of the Character Collider specific function. Have you changed that part of the code? If not, that might be the issue.

  • @llibertii
    @llibertii 8 місяців тому

    I've been looking for a tutorial like this for months, thank you very much!