ADVANCED SLIDING IN 9 MINUTES - Unity Tutorial
ADVANCED SLIDING IN 9 MINUTES - Unity Tutorial
In this video, I'm going to show you how to further improve my previous player movement controller by adding an advanced sliding ability, that supports sliding in all directions, sliding down slopes and building up speed while doing so.
If this tutorial has helped you in any way, I would really appreciate it if you leave a like in return. And you can also subscribe to this channel if you want to see more tutorials like this one.
Links:
➤ DOWNLOAD the SLDING SCRIPT: www.mediafire.com/file/41vtrm...
➤ DOWNLOAD the PLAYER MOVEMENT SCRIPT: www.mediafire.com/file/e8oudc...
➤ DOWNLOAD the PROJECT (in the free-code-dave channel): / discord
➤ MATHF.LERP Documentation: docs.unity3d.com/ScriptRefere...
➤ DON'T CLICK: bit.ly/2VcrDZt
➡️ Get Access to my full MOVEMENT LAB! ➡️
➤ Trailer: • MOVEMENT LAB - Unity P...
🏹 Get Access to my RANGED COMBAT LAB! 🏹
➤ Trailer: • RANGED COMBAT LAB - Un...
Other interesting videos :D
➤ THROWING Grenades, Knives and Other Objects - Unity Tutorial): • THROWING Grenades, Kni...
➤ FULL 3D ENEMY AI in 6 MINUTES! || Unity Tutorial: • FULL 3D ENEMY AI in 6 ...
Support me on Patreon:
➤ / davegamedevelopment
#UnityMovement #UnitySliding #UnityTutorial
Пікірлер: 371
If you need help with any of the code shown, just visit the "coding-help" channel on my discord server :D Also you can find many more movement tutorials on my channel in the "Tutorials!" playlist - I really hope they help you on your further GameDev journey! And in case you're interested in getting access to my full MOVEMENT LAB, where I combined all of the movement abilities shown in the tutorials and some more, check out the trailer: ➡ MLab Trailer: kzread.info/dash/bejne/a5OFm7exe5q8dps.html Also, since I know lot's of you are interested in ranged combat as well - I can gladly announce that I'm about to release my RANGED COMBAT LAB as well: 🏹 RcLab Trailer: kzread.info/dash/bejne/nGaN0s6inKvQc6Q.html Thanks so much for watching, hope this tutorial has helped you!
@Damian_h
10 ай бұрын
Dave me and some friends are working on a game that charcter is related to fire control. One question how would u tackle a grappling hook that looks like a fireHand going to the desired position and grabs the area to get hooked. At first i thought i can animate an arm with a morpher that stretches with a fire shader on the mesh but i realize this way the distance of the hook would always be fixed to the morpher/deformation distance. Another option is using LineRenderer with some kind of woodoo with a renderTrail but the thing is how i can get the initial position of the line renderer to add the hand(mesh) doing the animation. And another is using path creator that trace from point A to B a particle but im not sure whats the correct approach. Any idea?
@Garyson-cm8xk
25 күн бұрын
I'm having a problem, when I click Left Control it doesn't work. Do you know why?
@Garyson-cm8xk
25 күн бұрын
I'm having a problem, when I click Left Control it doesn't work. Do you know why
@Garyson-cm8xk
20 күн бұрын
never mind I fixed it
Thank you so much for this. I was struggling finding a tutorial on how to make slides, and this is really great
@davegamedevelopment
Жыл бұрын
Glad I could help!
Thank you so much for these tutorials. I ended up making my own sliding mechanic before this video was posted and it took me so long to implement and it didn't even work with ramps well so this video probably saved me many hours!
@davegamedevelopment
2 жыл бұрын
No problem, glad I could help!
Ayyy new tutorial awesome I have change things up Abit and the sliding and now it's kinda like apex or Titanfall and btw what an awesome tutorial man have a wonderful day my friend.
@davegamedevelopment
2 жыл бұрын
Thanks a lot, glad you like the video! :D
basics it's encouraging to learn a little bit more! Well done!
Yesssss, thats what i was looking for. hanks for helping
THANK YOU SO MUCH THIS WAS EXTREMELY HELPFUL :D
great thanks for that! Very clear and articulate!
Thanks dude...It helps alot especially on beginners like
Great vid, keep up the work man! 😁👍
@davegamedevelopment
2 жыл бұрын
Thanks a lot!
Wow I already know this is going to help thank you so much :D
@davegamedevelopment
2 жыл бұрын
No problem! :D
I literally don't have anytNice tutorialng to complain about, tNice tutorials tutorial is legit perfect!
This is the best free software Ive seen. Respect.
I am very glad that I stumbled upon your video
Great content thanks man hope to see ya get a surge in subs soon :) much love
@davegamedevelopment
2 жыл бұрын
Thanks a lot! :D
wow. thank you for the amazing video
Thanks again for another great tutorial
@davegamedevelopment
2 жыл бұрын
Glad you like it!
This Channel deserves way more subscribers. This has got to be the best tutorial I have seen on KZread so far. I gotta admit, I liked your fps controller better than Brackeys fps video. Love you videos, keep up the amazing work.
@davegamedevelopment
2 жыл бұрын
Thank you so much, hearing this really means a lot to me!
@sofiaonaga5352
Жыл бұрын
Exactly, I really did prefer this to Brackeys fps controller.
very very gooood, thaaankss maan✨✨✨✨✨✨✨✨✨✨
You train so well! It's like you comprehend my tempo...
You have no idea how grateful I am for tNice tutorials series
Great job! I subbed
@davegamedevelopment
2 жыл бұрын
Thank!
Thx dude, miss you
@davegamedevelopment
2 жыл бұрын
No problem :D
THANK YOU SO MUCH IT WORKS FOR ME!!!!!!!!!!!
and my friends are planning to make a ga and i'm making the soft, so tNice tutorials really helped
It's actually pretty easy to put the sliding script into the movement script, that way you don't have to change the crouch button to c, but instead both can be on the same button and the player changes automatically to crouching after a slide is over if the button is still pressed.
@pikapikalis
Жыл бұрын
how?
@retrospect8403
Жыл бұрын
How would we implement that into the script if you don't mind me asking?
@w0rkhop555
Жыл бұрын
@@retrospect8403 add new states to the state machine that determine if slidemovement should start and stop with bools and make sure that your crouch state doesnt conflict with any others states that it might (like air and crouch)
@d4ngerous143
Жыл бұрын
Does it not still work without changing the anything but giving them the same key bind?
@w0rkhop555
Жыл бұрын
@@d4ngerous143 if you set the if statements correctly in the state machine it shouldnt, i cant give you advice tho cause my state machine is super modified and scuffed compared to tutorial
A followup to the last video? This is great! Are you turning this into a series?
@davegamedevelopment
2 жыл бұрын
It's kind of a series yes :D
In The setup thank you so much!
Wish I found you sooner. Subscribed!
@davegamedevelopment
2 жыл бұрын
Thanks!
Cool lesson. TY
@davegamedevelopment
2 жыл бұрын
Glad you like it!
good job male, thanks!
Nice, I like these unity game devs
@davegamedevelopment
2 жыл бұрын
Thanks :D
ALL WORKING THANK YOU SOOOOOO MUCH BRO LOVE YOU PROFESSIONAL UNLIMITED ALL WORKING WELLL
love ya man
Hey! Great tutorial but I was having a big issue with the movepseed being set twice every frame by the lerp coroutine and the move speed = desired speed on line 178. The speed limiter would use the version set to desired speed every frame. I fixed this by putting speed control into the late update function. Do you have a nicer way to deal with this? I hate to have these variables competing so much
Thank you so much for this! Am I allowed to use this movement in one of my assets that I am going to publish? Thanks in advance
@davegamedevelopment
2 жыл бұрын
This is an open tutorial for anyone who wants to learn how to code sliding movement, use it for whatever you want :D
gracias hermano, muy util
OMG, thank you!!!!
Dave Thankyou !!!!!
@davegamedevelopment
2 жыл бұрын
No problem :D
Great stuff
@davegamedevelopment
2 жыл бұрын
Thanks!
nice software, gotta love it
Thanks so much
Thank you fam
THANK YOU
Im making a movement fps game this will help alot
Hi! i watched the video and it was very useful although i found a glitch where my character stops mid air when reaching a certain speed. Help would be greatly appreciated!
Really great stuff man, just wondering but what version of unity do you use?
@davegamedevelopment
2 жыл бұрын
Thanks, I use 2020.3.25f1
thanks dude
Toimii ! :) Kiitoksia, Tarvittin tätä
My camera got a little glitchy. Is there a way to smooth it out? But otherwise, after the first two tutorials, I subscribed immediately! this content is GREAT! Edit: I replaced Time.deltaTime in the PlayerCam script with 0.25f. It worked out great!
@atlantisfigi7583
Жыл бұрын
you can also replace Time.delta time with Time.fixedDeltaTime
@unloadedmaster1176
8 ай бұрын
Holy sh*t, it's way smoother now@@atlantisfigi7583
Adding momentum to crouching via changing moveSpeed to desiredMoveSpeed at 6:39 can sometimes make changing from crouching to walking kind of sluggish. A "solution" i am using is that i have a bool called crouching that is true when the crouchkey is down and false when the crouch key is up. When you check if desiredMoveSpeed has changed drastically at 7:20 i made the 'if statement' look like: if(Mathf.Abs(desiredMoveSpeed - lastDesiredMoveSpeed) > 4f && moveSpeed != 0 && crouching && Input.GetKeyUp(crouchKey)). Please let me know what you think, or if there is a better way for solving the problem, i really appreciate your tutorials! (the bool is probably unnecessary tbh)
@davegamedevelopment
2 жыл бұрын
The easier way would be to increase the 4. Something like: If(mathfs.Abs(desiredMoveSpeed - lasDesiredMoveSpeed) > 8) The difference of crouchSpeed to sprintSpeed should be smaller than this number
@shark_byte_online
2 жыл бұрын
@@davegamedevelopment thanks!
Nice stuff
@davegamedevelopment
2 жыл бұрын
Thanks!
thank you so much, this tutorial helped a lot! Just one question, how did you display the current speed of your player as text? I can only make it show the default speed, no acceleration (For example: 8,11).
@pmoodie
3 ай бұрын
public float speed; Update() { speed = rb.velocity.magnitude; }
@actuallystealthy
3 ай бұрын
@@pmoodie thx
@actuallystealthy
3 ай бұрын
@@pmoodie thx
your tutorials are treasure , love it keep going
@davegamedevelopment
2 жыл бұрын
Thanks a lot!
thank you
How would you make it a momentum based slide instead? My thoughts would be to stop adding movement force and set the ground drag lower If the player gets under a certain velocity the player crouches What do you think?
@davegamedevelopment
2 жыл бұрын
Sounds good, you could also add a low friction physics material to the player :D
I'm having a problem where on slopes when sliding I'm not actually pushed down onto the slope and I can still slide but kind of hover it causes the player to bounce of the slope every so often and makes the time go down eventually stopping the slide
@jacksonkennemer8553
Жыл бұрын
same I don't know how to fix it
@mellowrp7253
Жыл бұрын
Same Probleme here, did u find a fix?
@emeteil2440
7 ай бұрын
In the Sleding script in the SlidingMovement function after rb.AddForce(pm.GetSlopeMoveDirection(inputDirection) * slideForce, ForceMode.Force); I added rb.AddForce(Vector3.down * 30f, ForceMode.Force); and slideTimer stopped resetting, but small jerks remained (maybe it's worth increasing the length of vector3.down).
@emeteil2440
7 ай бұрын
For slideSpeed 30, Vector3.down * 150f is perfect and it doesn't seem to affect anything.
@taco73
26 күн бұрын
@@emeteil2440 a bit late but this helped me out, thanks
ti (the instrunt into the channel rack) and then it crashes the soft soft... Can soone help please?
I have a question. How the "Quaternion.FromToRotation()" function works? I need it for made a diferent slope handler system.
Bless u ❤❤❤❤❤
I have a problem where when i go to the slope and slide the timer is still there there are 0 errors and no coding differences pls help
Is there any way to make it so that I can’t slide up slopes because I am running into that problem, otherwise the tutorial is awesome
How did you get the effects chain on the left side of the setuper?
can this be used with the MMFPSE movement script from the asset store?
do you know how I can make it so sliding slows down when I am on ground and not using a timer because it feels weird with a timer
I was trying to code a way to decrease my moveSpeed while sliding by setting desiredMoveSpeed to 0 but even if my moveSpeed and velocity in the Inspector are 0 I'm still moving. How's that even possible? Does anyone know how to fix that? Thanks.
My slide works but the only problem is that when I hold any direction, the slide always goes slightly right of my direction. Does anyone have any ideas of what might be wrong?
I did a right click and drag on the soft roll, now if I click Play the position clock starts but my ti cursor does not move and I cant
my sprint doesnt work and after sliding I go crouching(which is what i want) crouch speed is the same as the walk speed after couching you are slower while walking, I even download both files and nothing is working please send help now
I'm having an issue after adding this script. Everytime my player spawns, it gains a bit of momentum from a microscopic fall. When the player trys to move, the speed is set to 15m/s and slowly slows to the walk speed. I have no values set to 15m/s + all the values are the same as yours. Not even adding a trigger to manually set the speed to 7m/s works. Does anyone how I can fix this?
because its hard doesn't make it impossible! Stay safe!
thats a good sign imo
Dave do you also have an updated vid on wallrunning or do I just copy the one on the movement lab vid
@davegamedevelopment
2 жыл бұрын
I'm doing an updated Tutorial soon
the top, when I installed soft soft (restart didn't help). I have a creative softblaster z softcard. I'm assuming it has sotNice tutorialng to do
help does anyone know why it says error CS0019: Operator '-=' cannot be applied to operands of type 'bool' and 'float'
Idk why i feel like my camera is getting lower at a certain point while sliding down a slope, i tried to literally copy paster the code from the file but it stayed the same, can u please help me fix the problem i have no clue whats causing that...
Great video, I have a small request could you please make then Pick up items and stamina bar with sprint :D?
@davegamedevelopment
2 жыл бұрын
I'll think about it, thanks for the suggestions :D
you're the best
@davegamedevelopment
2 жыл бұрын
Thanks :D
The sprint speed started to increase slowly after adding the speed increase during the slide, how to fix it? Tell me, please
When colliding with obstacles, like a wall, it gets stuck (kind of like a cactus). Is there a way to change it so that it doesn't get stuck on objects and walls.
Don’t be afraid, just embrace it.
So there is a very slight visual bug that happens with this when going down a slope the player obj will float just above the slope and seems to randomly just drop down to the slope but when going up a slope this doesn't happen
@davegamedevelopment whenever i slide, my height doesnt get shrunk down enough no matter the number i put in the y scale, the slide works but my height only goes down a little
Hi I have a problem where this Error appers "Assets\PlayerMovement.cs(193,16): error CS0428: Cannot convert method group 'OnSlope' to non-delegate type 'bool'. Did you intend to invoke the method?" P.S. I'm new to programming and just followed to tutorial.
you sound like Brackeys ^^ nice tutorial btw!
@davegamedevelopment
Жыл бұрын
Haha I know, thanks a lot!
tutorial of how to add the thing that shows the speed?
Dave I’m having an error that says “cannot convert from ‘UnityEngine.Vector3’ to ‘System.Collections.Specialized.BitVector32’
would you be able to link the tester scene in the description please? thanks
@Dave/GameDevelopment pls help me I can't figure out how to make momentum work also I kind of bounce on slopes I think my OnSlope() is broken or something but probably not because it kind of works when i'm going up a slope.
My player still seems to bounce while sliding down a slope, also what problems does it cause if you leave the keybinds the same?
@vagabxndd
Жыл бұрын
did you ever fix this?? im bouncing while sliding down a slope too
i thank you for a short video that brakeys dosent have
@davegamedevelopment
2 жыл бұрын
No problem, glad you like it! :D
for some reason, everything up to 4:25 works with regards to sliding, but for some reason the AddForce for sliding doesnt work and the player floats while sliding, any way to fix this?
@thegingergamer5396
Жыл бұрын
Same problem for me aswell
it didn't work. but i accidentally made a boost system kinda like the boost in Doom Eternal. I think I'm just gonna use the boost thing in my game. Awesome tutorial!
Why does my player scale stay the same when i slide? It doesn't use the slide scale
Very awesome tutorials, I did all the steps, but now suddenly my player wont sprint?
Hi Dave, after following the tutuorials I have a problem where the player speed changes very slowly from one state to another. For example If I'm crouching, the movespeed changes to crouchspeed by decreasing very slowly, and the other way around too. Is there any solution to this? Because in the game I need to keep moving as fast as possible.
@hrize
2 жыл бұрын
nvm fixed it
@lslhbeats3429
2 жыл бұрын
@@hrize How?
@hrize
2 жыл бұрын
@@lslhbeats3429 I increased the speed multiplier to someting around 5
@lslhbeats3429
2 жыл бұрын
@@hrize hmm interesting, and thanks for the help!
It says errorCS1585 Member modifier public must precede the member type and name how do I fix?
cool!
I have a Issue that when I move Forward or Backwards im extremely Slow and Crouched
been working on this, but even having the code remade i cant gain momentum in the slopes, anyone having the same issue ?