Nowadays, most of the Unity tutorials on the internet are like a 20 minutes long mess just to do a simple dumb thing, but your channel changes everything, very well explained tutorials that go straight to the point and are easy to understand, you earned yourself a new sub.
@KetraGames
2 жыл бұрын
Thanks very much for this comment 😊
@Maaztig
3 жыл бұрын
This channel is severely underrated.
@KetraGames
3 жыл бұрын
Thank you! 😊
@Johannes00
2 жыл бұрын
There are so many games which skips this kind of mathy step and keeps the awkward slope-bounce. Now that I've seen what to do I'll make sure to set a good example by following your most helpful instructions. You have my appreciation Ketra.
@KetraGames
2 жыл бұрын
Really glad to hear this 😊
@realOddieOne
2 жыл бұрын
This is officially THE BEST and the only correct way to remove bounciness from CharacterController on a slope! Thank you for a tutorial.
@KetraGames
2 жыл бұрын
Thanks for this comment 😊
@MrVook
2 жыл бұрын
Very elegant solution compared to others i have seen and used. I have just switched my own character controller over to this method!! Thanks for the video :)
@KetraGames
2 жыл бұрын
Thanks, great to hear 😊
@radiocage
Жыл бұрын
Thank you, I implemented this fix into a first-person character controller, which is working flawlessly with just a little tweaking.
@Technocyde
2 жыл бұрын
Thank you for sharing this. Slopes can be tricky and time consuming, but your method solves this simply and efficiently.
@KetraGames
2 жыл бұрын
Glad you found it useful 😊
@flyingroads3498
2 жыл бұрын
Love how you explain everything so nice and clear. You have a subscriber here
@KetraGames
2 жыл бұрын
Great, thanks for this 😊
@puntalic
3 жыл бұрын
Wonderfull short, useful and clear explanation. Thanks!
@KetraGames
3 жыл бұрын
Glad you found it useful 😊
@BobTheSkateboard01
2 жыл бұрын
I made a video that solved this problem in many complicated steps. You solved it in such a simple and elegant way. Great work!
@KetraGames
2 жыл бұрын
Ah thanks for this comment 😊
@tech.curiosity
2 жыл бұрын
I was looking for this, thanks a lot.
@KetraGames
2 жыл бұрын
👍😊
@modernator
4 ай бұрын
This works. Thank you!
@vindisl908
Жыл бұрын
This is exactly what I was looking for. Thank you so much!
@KetraGames
Жыл бұрын
Great to hear 😊
@vitvohralik5557
2 жыл бұрын
Perfect! Simple and useful, thank you
@KetraGames
2 жыл бұрын
Thanks, great to hear 😊
@steeltm521
3 жыл бұрын
Thank you very much! Love your videos!
@KetraGames
3 жыл бұрын
Thanks for this great comment! 😊
@prophet9154
Жыл бұрын
Hey! I have an issue with this code. The rotation of the velocity is applied incorrectly and my character controller is being pulled across the plane instead if directly into it
@justingifford4425
2 жыл бұрын
Man I need to learn Quaternion math. Thank you!
@KetraGames
2 жыл бұрын
👍😊
@arjunmehta2853
Жыл бұрын
While this works, if the player speed is too fast(before reaching the sloped surface) then the player is just gonna skip off and bounce. How can we allow the player to stick to the slope surface even at faster speeds? Increasing the gravity is not a good solution as it creates weird behaviour in the physics, do you have any ideas? Thanks in advance! Example: the sonic games have such behaviour where the player is always stick to the ground
@D0RN0
5 ай бұрын
Thank you so much! I was able to translate this code to work in my Roblox game :)
@ryuined
Жыл бұрын
this worked like a fucking charm i love you
@jakekingston5075
2 жыл бұрын
Very nicely explained. I'm using the character controller component which if I'm not mistaken uses almost exactly this method to handle slopes. I'm just wondering if (using this method) you also get the weird teleportation that occurs when you walk off the side of the slope as opposed to down it? Trying to find a fix for that at the minute 😩
@Rauza31
Жыл бұрын
I have that same issue, Did you ever find a solution?
@Rakhu-e2f
3 жыл бұрын
I was thinking how to do this and you made a video thank you ma'am 😊 You teach each and every concept in a smooth way ☺️ Ma'am when I will make a game in the future will you review it ? ☺️
@KetraGames
3 жыл бұрын
Great to hear this. We look forward to seeing your game 😊
@Rakhu-e2f
3 жыл бұрын
@@KetraGames Ma'am but how can I share my game with you ?
@KetraGames
3 жыл бұрын
If you have it hosted somewhere you can send a link to ketra.games.unity@gmail.com
@Rakhu-e2f
3 жыл бұрын
@@KetraGames yes I have uploaded on itch.io I will give you the link 🙂
@Iridium.
2 жыл бұрын
Thanks so much!
@KetraGames
2 жыл бұрын
👍😊
@ronansmith8226
2 жыл бұрын
I tried another method from Acacia Developer but it stopped me from jumping while going up slopes, this fixed the issue, thanks!
@KetraGames
2 жыл бұрын
Great, glad it was useful 😊
@fs6783
Жыл бұрын
I have a problem after following the tutorial. Player movement slows down when going down the slope. How to make the speed constant?
@zendraw3468
2 жыл бұрын
you can get the normal from the oncollisionenter function so you do it only once and not constantly.
@KetraGames
2 жыл бұрын
Thanks for the tip 😊
@lilboiUK
2 жыл бұрын
very helpful thank you!!!
@KetraGames
2 жыл бұрын
Great to hear 😊
@kmanb
2 жыл бұрын
How did you add gravity?
@KetraGames
2 жыл бұрын
Hi, this video covers how we added the gravity - kzitem.info/news/bejne/2qSenZZjeoeEg3o Hope that helps .😊
@kimmsoft2691
3 жыл бұрын
Hi there, Wonderful informative video! i wonder if you are using any other colliders or are you only using Raycasts for collisions? I am myself pretty new to Unity and struggling with this issue with my "pixel" platformer using unity physics engine, where ive tried out 2D capsulecollider, 2dboxcolliders etc.. I want the object to stick to the ground/slope no matter what and the only thing ive heard is that i should use my own physics in that case. So to the question..does this work for a 2D platformer? And in that case should i avoid using 2DBoxColliders etc and only use Raycasts?
@KetraGames
3 жыл бұрын
Hi, this is using Unity's character controller which uses a Capsule Collider to detect collisions. If you want to always stick to the ground then you could use Raycasts to detect the ground and reposition accordingly. You'll probably still need colliders as well though to detect collisions with walls/other game objects.
@kimmsoft2691
3 жыл бұрын
@@KetraGames Okay good to know, thanks for the reply! Keep up the amazing work
@Inari-S.O.S
Жыл бұрын
What about if I'm using the new input system with Playmaker for movement
@AporiaLester
2 жыл бұрын
Really good video! :) Theres just 1 error still arround: If you walk rly rly close on the edge of a slope you still bounce because the raycast is send from the middle of the Player. Walking on the edge causes the middle to have no ground to detec beneath it, so the bounce returns. :(
@KetraGames
2 жыл бұрын
Hi, thanks for pointing this out. We'll take a look and see if we can come up with a fix for this.
@just_gaminlive3402
Жыл бұрын
im using brackeys code and when im on slopes i cant jump how do I fix this
@ljubagingel875
2 жыл бұрын
How can i use it in the Unity Platformer tutorial with animations?
@KamuCreates
3 жыл бұрын
will this also make your character slides down if the angle is too steep?
@KetraGames
3 жыл бұрын
Hi, this won't make the character slide but it gives you a good start point to implement that functionality. We'll look to cover slope slide in a future video.
@MikeKing710
2 жыл бұрын
Could someone show an example how to use this solution in Playmaker?;(
@sethdossett1304
2 жыл бұрын
do you have a video on how to make player move faster downhill and slower uphill?
@KetraGames
2 жыл бұрын
Hi, not at the moment but we'll add it to the list 😊
@FioreFire
Жыл бұрын
The character still bounces when it moves off the very end of the slope
@YamomotoSC2TV
Жыл бұрын
you are awesome
@KetraGames
Жыл бұрын
Thank you 😊😊
@pliperkiller
2 жыл бұрын
Thank you for the amazing guides, just to make an observation I found, this method has conflict with coyote time. I tried it with negative delay time and worked ( but it doesn't let me jump anyway :p )
@KetraGames
2 жыл бұрын
Thanks so much for highlighting this 😊 A few people have been having some difficulty with this video and I've not been able to find the issue, but coyote time may well be a factor. Once I've got to the bottom of it I'll look to redo this video with the necessary corrections.
@jelliottmason
2 жыл бұрын
@@KetraGames Have you found a way to make this work with coyote time?
@madmaxdx3326
2 жыл бұрын
I can add sliding animations on the character and how plz anser
@KetraGames
2 жыл бұрын
Hi, this is on the list for future video
@murraymon
2 жыл бұрын
it doesn't seem to be working for me, I am still using a capsule to represent my character, would anything change cuz the proportions are different?
@murraymon
2 жыл бұрын
I think it does, I changed the raycast distance from 0.2 to 1.5 and it worked!
@fightmike9660
Жыл бұрын
@@murraymon Solved my problem, thx. 👍
@nikolas276
6 ай бұрын
not worked for me(
@Vin_i1
Жыл бұрын
I wish there was a tutorial like this on Roblox studio
@Freak-px9uk
3 жыл бұрын
My problem is that the object bounce when it suddenly stop when climbing a slope.
@KetraGames
3 жыл бұрын
Hi, sorry I'm not able to recreate this. Do you mean that the character bounces straight up into the air when you stop after moving up the slope?
@Freak-px9uk
3 жыл бұрын
@@KetraGames Yes, but only when the object abruptly stop after moving fast, it looks like that the object hit the diagonal of the slope, then it jump a little, I guess it's expected for capsule collider bounce when hitting an inclination since it base is round, but for a character with feets it look weird.
@KetraGames
3 жыл бұрын
Are you using CharacterController or RigidBody to move the character?
@Freak-px9uk
3 жыл бұрын
@@KetraGames I use a personal script that move the character using root motion. Anyway, I found a solution already, restrain the position in the rigidbody the moment it stop, then free in the next frame. Thank your for your interest to help by the way, fixing the descending slope is also useful.
@KetraGames
3 жыл бұрын
Great, glad you worked it out 😊
@yothornberry7079
3 жыл бұрын
How to implement this with unity starter assets 3rd person capsule controller. It has this problem but doesn't use velocity to move
@KetraGames
3 жыл бұрын
Hi, in the 3rd person starter assets there is a targetDirection that is used to move the character. You would want to align this direction to the slope rather than the velocity. Hope that helps 😊
@yothornberry7079
3 жыл бұрын
@@KetraGames thank you it works to detect slope but slows regular movement speed on slope. i think its how the movemnt is coded, but heres what i have in case im doing something wrong. ----to move the player---- Vector3 targetDirection = Quaternion.Euler(0.0f, _targetRotation, 0.0f) * Vector3.forward; targetDirection = AdjustTargetDirectionToSlope(targetDirection); // move the player _controller.Move(targetDirection.normalized * (_speed * Time.deltaTime) + new Vector3(0.0f, _verticalVelocity, 0.0f) * Time.deltaTime); ----Method---- private Vector3 AdjustTargetDirectionToSlope(Vector3 targetDirection) { var ray = new Ray(transform.position, Vector3.down); if (Physics.Raycast(ray, out RaycastHit hitinfo, 0.2f)) { var slopeRotation = Quaternion.FromToRotation(Vector3.up, hitinfo.normal); var adjustedTargetDirection = slopeRotation * targetDirection; if (adjustedTargetDirection.y < 0) { return adjustedTargetDirection; } } return targetDirection; }
@yothornberry7079
3 жыл бұрын
@@KetraGameshere is a short video I made explaining the problem. kzitem.info/news/bejne/p41nk52hpV-LlJw
@KetraGames
3 жыл бұрын
Hi, thanks for posting the video. Something definitely isn't quite right but I can't see anything obvious in the code at first glance. I'll have a go at recreating it when I get some spare time. Let me know if you find a solution in the meantime.
@yothornberry7079
3 жыл бұрын
@@KetraGames tysm
@gabrieldeoliveirabelarmino7461
Жыл бұрын
♥
@AllInOne-sy1fl
3 жыл бұрын
please create some videos on 2D projects
@KetraGames
3 жыл бұрын
Hi, we'll definitely branch out into 2D at some point.
@hex7shadow202
2 жыл бұрын
Not compatible with brackeys movement tutorial it just sends the character into the abyss kzitem.info/news/bejne/wIeX0KaXm6uFfZg (im new to unity btw so it maybe stupid idk)
@itzdrify5678
2 жыл бұрын
it doesnt work for me :(
@KetraGames
2 жыл бұрын
Sorry to hear that. This is one we plan to revisit at some point in future videos
@ramshyblood
2 жыл бұрын
we need this to 2d :(
@irl_sonic
3 жыл бұрын
it didnt work i still fall of the slopes
@KetraGames
3 жыл бұрын
Sorry it's not working for you. You can try to copy the script from here to see if that helps - dotnetfiddle.net/VpfYvo
@KetraGames
3 жыл бұрын
Another thing that you may need to do is raise the position when casting the ray down as it may be too low to pick up the collisions. So, var ray = new Ray(transform.position + new Vector3(0, 0.5f, 0), Vector3.down);
@paquinho12
2 жыл бұрын
@@KetraGames Didn't work for me aswell, even trying the alternative solution :/
@murraymon
2 жыл бұрын
@@paquinho12 it doesn't seem to be working for me either, did you ever find a solution?
Пікірлер: 114