How To Create PATHFINDING in Godot 4

How To Create PATHFINDING in Godot 4

DevWorm

1 год назад

67,745 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Abdo23
Abdo23 - 17.11.2023 20:19

Is there a way to use the tile map in the navigation process? Meaning, the enemy would move from cell to cell like X-COM.

Ответить
codyhop1
codyhop1 - 12.11.2023 22:22

This is a bit late, but why are you including '-> void' doesn't gdscript already return void if no return type is specified?

Ответить
BaratãO
BaratãO - 12.11.2023 00:01

hey my man, you really helped me out, thx. But I need to make it follow only on 4 directions, cause in my game the player and enemies should only go up, down, left or right, without diagonals. What do you suggest?

Ответить
ShortChessOpenings
ShortChessOpenings - 01.11.2023 00:42

Very nice video,
is this approach also possible for isometric 2D maps ?

Ответить
shiningpaladin
shiningpaladin - 23.10.2023 21:30

I appreciate this tutorial. I was wondering how do you apply this to something more platformer like and not top down. Like making an enemy moving along the ground? I tried to modify the part with velocity = dir * spd, for gravity and now the character isn't moving.

Ответить
Kayck Br
Kayck Br - 23.10.2023 03:55

TILES MAP:
i did some thinking and now i found how you can make the AI correctly seek the path if you have multiple layers of tiles.

1: make a new layer for "Navigation layer tiles" set the Z index to -100 so ou never see ingame, or make the modulate transparent.

2: Make a alternative tile of something else you want to have reference of. Dont set collisions.

(optional) change the modulate color to blue for a better reference.

3: paint the navigation for these alternative tiles.

4: if you have "Half tile" then make a alternative for them and set the navigation.

5: fill your map according to your needs of navigation. If you have half blocks remember to fill then with the inverse blocks you made.

DONE.

now you have a complete, full navigation that you have controll of. With the ability to precise navigations because of the alternative tiles. I find myself do much intelligent for discovering this fix of multiple layers tiles and half tiles.

Ответить
Kayck Br
Kayck Br - 23.10.2023 02:36

brooo💀💀💀💀 i didnt really notice you could easily set navigation to tiles just like that. I manually set the polygons myself(didnt really took that long) but causes a lot of weird issues with pathfinding. Of course, this engine has everything!

Ответить
Anthony Brown
Anthony Brown - 17.10.2023 14:36

Hmm even with the wall slide 0 my character gets stuck on walls

Ответить
Spang1e
Spang1e - 15.10.2023 07:29

Does not seem to work if you use layers for the tilemap, any ideas? Thanks for this video :)

Ответить
PunCala
PunCala - 10.10.2023 14:08

I was following another tutorial and a problem came up: suppose you put some object there with collision. You'd then have to make the navigation mesh go around it, but how do you make sure the enemy can find the path around from both sides? It seems to need a way to connect two navigation areas, and it doesn't seem to always work. This video sort of bypasses the problem by putting the navi mesh into the tileset, but it only works if tiles are the only things you use in your game. Still, great video as always.

Ответить
David Orchard
David Orchard - 05.10.2023 01:12

Awesome tutorial. I wish you'd zoom in on the code you're typing though. Hard to read on smaller screens 😊

Ответить
Herman Darr
Herman Darr - 26.09.2023 08:08

its Ga-Dough not Go -Dot

Ответить
Shanjei Guna
Shanjei Guna - 20.09.2023 19:33

That is insanely simple! I got this recommended just when I needed it.. Thanks for this!

Ответить
PyDude
PyDude - 13.09.2023 18:31

Well. You just saved my laptop from being smacked at the wall. Well done

Ответить
ll_ll
ll_ll - 30.08.2023 12:58

Thanks for the explanation, but I have a problem that the enemy gets stuck in the wall, even though I made the motion mode floating,why?

Ответить
unlimited cotton
unlimited cotton - 26.08.2023 01:26

thank you so much!

Ответить
USSR Games Studio
USSR Games Studio - 23.08.2023 08:55

Do verison 3.0 because if i switch to 4.0 it will be very broken

Ответить
Slayer 848
Slayer 848 - 24.07.2023 19:30

how to make look at the player, the look_at not work.

Ответить
Manu Yeeeha
Manu Yeeeha - 23.07.2023 02:55

what i am missing: put wait on tiles for good/bad ways.
make the enemy only move UP/LEFT/RIGHT/DOWN if you make streets this is just useless :(

Ответить
Joergen Meiersberg
Joergen Meiersberg - 20.07.2023 02:58

In complex scenarios 100 agents will drop the fps below 60 fps? Is there a way to improve this?

Ответить
findot777
findot777 - 08.07.2023 21:26

show us how to make the enemies avoid each other

Ответить
Matthew Holmes
Matthew Holmes - 07.07.2023 19:17

Hey could you do one on navlinks?

Ответить
Trenton Beeson
Trenton Beeson - 30.06.2023 21:47

This tutorial was awesome! I’m making an rpg with 4 directional movement and wondering if there was a way to make the movement of the path finding 4 directional instead of 8 directional

Ответить
Muhamad Agung Maulana
Muhamad Agung Maulana - 26.06.2023 18:55

i got some bug where my navigation stuck being a straight line between collision wall, and not curving the path, can u help me solve this?

Ответить
CatMagic
CatMagic - 26.06.2023 17:32

I really need help. This is not working. The debug path is showing going around the walls but my enemy just walks right through them.

Ответить
Lars
Lars - 23.06.2023 21:13

Are all your tutorial videos cc0 license? Like can I use them in game without licensing? Or what is the license? Thanks!

Ответить
youcef_dev
youcef_dev - 23.06.2023 16:03

is these work with godot 3 ?

Ответить
IEatSoap
IEatSoap - 21.06.2023 16:17

Is there a way where it can find multiple targets, go to the nearest one and so on?

Ответить
L. Halawani
L. Halawani - 15.06.2023 18:47

+ Sub, been looking for a good tutorial on this.
Also looking for:
- UI mechanics and how to think about it and plan it for games
- Detailes on how to use tilemaps and tilemaps with custom data

Ответить
UnknownJF
UnknownJF - 13.06.2023 16:31

hey, how could it be increased a check for static bodies?

Ответить
Joergen Meiersberg
Joergen Meiersberg - 11.06.2023 11:39

Thank you for this specific focused tutorial. I had a tree in my scene with a rectengular collision shape (so that all players and npcs are able to walk behind and in front of it). My npc is getting stuck at the tree and is not trying to get arround. Is this the correct behavior, that it does not try to get arround and is trying to get through that collision? Is there a correct way to cope with this? Or do i have to code a function where it checks its own position and tries to move left or right to go arround if the npc is not moving its position for a certain time?

Ответить
Programming Of All
Programming Of All - 07.06.2023 13:17

Bro it helped me thanks for this video really appreciate this.

Ответить
DevBros
DevBros - 04.06.2023 22:21

thanks Man great video but I want to know why my enemy gets stuck in walls even tho I made the motion mode floating and made the wall slide thing to 0??

Ответить
Rick Roller
Rick Roller - 03.06.2023 00:14

Is there any way you could add a segment at the end of your tutorials where you show all the finished, completed scripts? It's killing me having to go back, rewatch, go back, rewatch trying to catch what I did wrong. I've been stuck on scene transitions because I can't see the difference between your finished product and mine.

Ответить
Junhyeok Jeon
Junhyeok Jeon - 30.05.2023 13:27

Omg it's so easy!! thanks a lot for tutorial XD

Ответить
BallerMan482
BallerMan482 - 30.05.2023 09:10

How would I do this in 3d?

Ответить
Gonzalo Ramirez
Gonzalo Ramirez - 29.05.2023 15:50

Incredible! Thank you very much for your updated tutorials. Is there a possibility that you make a tutorial explaining multiplayer? since in Godot Engine 4 it seems that they made things easier in the field of networks. Greetings from Argentina!

Ответить
Koni Chan
Koni Chan - 28.05.2023 05:28

For some reason, this don't work for me. My enemy object is just standing. What things do you think I have to check?

Ответить
Sammy T
Sammy T - 27.05.2023 05:15

Thanks so much for this. I didn't realize it was the motion mode that was causing me so much headache.

Ответить
Paul Kohler
Paul Kohler - 25.05.2023 21:00

I appreciate these concept video more after doing the 2d RPG series as it helps me learn it better to figure out how to apply these standalone videos to the bigger game. Happy to learn about exports here, as I was wondering what the equivalent of a public or serialized GameObject in Unity inspector was until now. :)

Ответить
Ragnar Pettersson
Ragnar Pettersson - 25.05.2023 13:21

Really nice tutorial, do you now how to add costs to the path? like pathway, grass, hills etc so pathway is less costy then grass for an example

Ответить
Yajnesh Skandhan
Yajnesh Skandhan - 24.05.2023 14:11

Man pls do about preset room generation, I had to do the generator myself and it still had errors, pls do vid about it 🙏

Edit: pls man do a vid about it(it should be preset rooms)

Ответить
Mathijs Frank
Mathijs Frank - 24.05.2023 13:05

I think you're missing a word in your title.

Ответить
TheMaJestic14
TheMaJestic14 - 24.05.2023 09:08

Great video my man , can you explain why you made the physics function to void? What does thag do?

Ответить