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_ 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.
@@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
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.
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?
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.
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.
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 😭
I wish this video had showed up when I was trying to figure this out months ago, really super tutorial!
I've been looking for a tutorial like this for months, thank you very much!
Camera may be jittery in your part but if you add sparks behind the player it kinda looks good with the jitters
Thx a lot been trying for a while now, this is a good solution 🎉
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?
Nevermind, man its late. im dumb for not just remembering i can use physics.spherecast
@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.
@@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
Thank you
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.
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?
The transform.rotation lines during MovePlayerAlongRail() dont seem to be actually working I dont think it's possible to rotate rigidbodys like that
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.
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.
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 😭
Go for it. There's a GitHub link to the project files in the description.
Can you use this for 2d projects?
The core principles are probably the same, you might need to some adjustments to the rotations. Maybe I should make a separate video about it.