Тёмный
No video :(

Stop Character Sliding Down Slopes in Godot - Godot Quick Tips 

Code with Tom
Подписаться 13 тыс.
Просмотров 10 тыс.
50% 1

Have you ever noticed that your character slides down slopes when using the move_and_slide function in Godot? In this video I show you a quick and easy solution to stop your character sliding down slopes in Godot 3.4.
Shout out to 3Dude whose video helped me with this common problem. You can find his original video here: • Video
---
Patreon: / codewithtom
Discord: / discord
Twitter: / codewithtom
Github: github.com/cod...

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 48   
@ikim76
@ikim76 2 года назад
This is great, this is the best solution for this problem. For anyone interested, the reason this works is this: when we multiply the velocity by the floor normal vector, this effectively adds a velocity.x amount that counters the velocity.x value that the engine adds automatically to simulate objects being pulled down by gravity and thus making them slide in the direction of the slope. While your character is on the slope, gravity changes direction to the floor normal, and to the engine it is as if it is not a slope at all.
@Speed-TV
@Speed-TV Год назад
I tried this with 2D, and it didn't work :( The only thing I did differently was replace Vector3.UP with Vector2.UP
@pinu8348
@pinu8348 11 месяцев назад
Mine didn’t either and this video was the earliest thing that shows up on the front page when searching for this problem. Incase anyone still using 3.5 reads this, I fixed my problem by putting the “safe margin”(kinematicbody2d > collision) above the default value
@evarobison
@evarobison 2 года назад
Thank you so much! I was just struggling with this issue a few days ago.
@CodeWithTom
@CodeWithTom 2 года назад
Really hope this helps you resolve the issue :)
@bloodlust_unlimited
@bloodlust_unlimited 2 года назад
Good to see you again! Thx for content!
@bruhnah4life
@bruhnah4life Год назад
Thank you very much for this tutorial, at first it was buggy because i didnt put my code and the new code with the exact order, thanks
@CodeWithTom
@CodeWithTom Год назад
Glad it helped!
@davidmurphy563
@davidmurphy563 2 года назад
Hope everything is fine. Will you be continuing with the channel? Imho, it was the best technical tutorial content for Godot.
@McKack
@McKack 2 года назад
Weird, I seem to recall reading or hearing somewhere that 3.4 was supposed to fix this. Maybe it was only for 2D :\ Either way, this solution is clean and simple! Looks like the best one so far! Any issues with snapping to ground so you don't fly off the end of upward slopes or bump down slopes?
@CodeWithTom
@CodeWithTom 2 года назад
It's been a particular bug bear of mine for quite a while and I've been hoping it would be fixed for a while. I haven't experienced any issues with leaving the ground at the top of slopes but I'll do some further testing and post an update if this is the case. I believe the move_and_slide snapping options could be used to ensure this doesn't happen if that's the case.
@McKack
@McKack 2 года назад
@@CodeWithTom Awesome! I'll be testing it out on my test project as well soon, replace a bunch of messy lines of code with this instead and see how it fairs :)
@ClawMacKain
@ClawMacKain 2 года назад
Sadly as someone making a 2D game using Godot using ver 3.4.4 the sliding slope issue is still a thing. And because of that I'm currently trying to find a code to negate it for my game. Sadly the code Tom provided doesn't work for a 2D build it seems.
@dueddel
@dueddel 2 года назад
Great to see you being back again, by the way. 😘
@spikedpancakes
@spikedpancakes 2 года назад
Hey thanks to you, i wrote my first script, i followed one of your other vids, I hope to take up game design in tge near future!
@alexxxiy69
@alexxxiy69 5 месяцев назад
if not is_on_floor(): velocity.y -= gravity * delta
@tanushbissessur2032
@tanushbissessur2032 2 года назад
you are the biggest help i will ever have.
@pravinvjreigns6055
@pravinvjreigns6055 Год назад
Thank for your video,it is really useful
@houseofosborne1173
@houseofosborne1173 Год назад
Also rip, great teaching channel
@coder-serwin3545
@coder-serwin3545 2 года назад
Amazing bro! Love ur Content..
@CodeWithTom
@CodeWithTom 2 года назад
Thank you, glad you enjoyed it!
@coder-serwin3545
@coder-serwin3545 2 года назад
@@CodeWithTom :)
@fingorchipz8662
@fingorchipz8662 2 года назад
He's back 😊😊
@DejaimeNeto
@DejaimeNeto 2 года назад
yes
@artisanpixel
@artisanpixel Год назад
Any update for how to get this working in 4.0 ? They screwed up the new CharacterBody3d, and now it is all buggy and can't get sliding on slopes working like this anymore! Hope you can figure it out.
@shardaojha7558
@shardaojha7558 Год назад
Hello sir, were are you now these days. Is your health ok?? You can always ask for help to me thank you
@joemop8790
@joemop8790 2 года назад
great stuff 😄
@kulak8548
@kulak8548 Год назад
Any plans to continue the channel? Would love to see some more AI content like the FPS in Godot part 4.
@kryperdev
@kryperdev 2 года назад
Brilliant!
@kochkarov
@kochkarov 2 года назад
Thank you for a great video! Are you planning to expand this by adding movement on stairs?
@CodeWithTom
@CodeWithTom 2 года назад
Thanks, I'm glad you liked the video. Actual stairs are a bit trickier but can also be "faked" by simply making the collision area of the staircase a simple slope.
@dafellachallam7384
@dafellachallam7384 2 года назад
Hey Tom, In your 2nd episode of "how to make a fps game" I have a problem it says *attempt to call function 'is_colliding' in base 'null instance's on a null instance
@MikeMcRoberts
@MikeMcRoberts 2 года назад
Why did Tom's videos suddenly stop 8 months ago? is Tom OK?
@kulak8548
@kulak8548 Год назад
He has recent posts on Twitter, so he's still kicking. Hopefully he'll make a comeback.
@1luckyjo
@1luckyjo 2 года назад
Brilliant Tom xxx
@CodeWithTom
@CodeWithTom 2 года назад
Thank you :)
@velsia123
@velsia123 Год назад
tried your solition and it made my character slide faster....
@Tox_sickle22
@Tox_sickle22 2 года назад
Id like to see a video about git Godot integration it is really confusing id really like you to make a video about it
@pucksclips6383
@pucksclips6383 Год назад
So I’m learning your tutorial on how to make an fps game in Godot from 2019 and my character only moves right and if I want to move forward or backward I have to be moving right at the same time and left just doesn’t do anything. Any fix?
@friendlyreptilian3767
@friendlyreptilian3767 2 года назад
thx!
@houseofosborne1173
@houseofosborne1173 Год назад
Based
@thezadek
@thezadek 2 года назад
honestly, this was there for so long that it's making me lose faith in the engine. i am noticing similar pattern with the new 2D features in Godot 4.0 where they have been broken since implementation and no one dropped single comment on those and the maintainer's outright refusal to add proper masking features. why should i waste my time with an engine that lacks something so basic?
@__Rizzler__
@__Rizzler__ 2 года назад
Yea thanks mate
@CodeWithTom
@CodeWithTom 2 года назад
You're very welcome :)
@__Rizzler__
@__Rizzler__ 2 года назад
@@CodeWithTom you too sir.
@problemletstalknoletschat2288
@problemletstalknoletschat2288 2 года назад
Btw. do your "old" Godot FPS Controllers still work in v3.4.4 ?
@kulak8548
@kulak8548 Год назад
They do, and I was able to get them working in 4.0 as well with a few minor changes.
@problemletstalknoletschat2288
@@kulak8548 Thanks a lot fellow dev!
Далее
Why Stairs Suck in Games... and why they don't have to
11:24
🤪Школьники ОЦЕНЯТ🔥
00:30
Просмотров 131 тыс.
Godot Recipe: 3D KinematicBody: Align with terrain
15:48
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
Просмотров 511 тыс.
I Made My First Game in Godot in 3 Weeks...
26:21
Просмотров 315 тыс.
Loops, Signals, get_node & call_deferred in GDScript
14:44
How to Make a Good 2D Camera
11:38
Просмотров 399 тыс.
Using Composition to Make More Scalable Games in Godot
10:13
Slope Movement in #GodotEngine
15:22
Просмотров 25 тыс.
A new way to generate worlds (stitched WFC)
10:51
Просмотров 525 тыс.