Тёмный

Tilemap PATHFINDING in Godot 4.2 

Cashew OldDew
Подписаться 1,4 тыс.
Просмотров 20 тыс.
50% 1

This video aims to solve the issue of setting up navigation baking in combination with Tilemap collisions since it was not as straight forward.
A very important aspect to notice is that the navigation area calculation based on the active collisions works only if those collisions are on the layer 0 of the tilemap. More information on this can be found in this discussion: github.com/godotengine/godot/...
Additional thanks go to @abradotcs for making this video which was the inspiration for the initial setup of the navigation agent: • 2D Navigation/Pathfind...
The tileset assets are from schwarnhild: schwarnhild.itch.io/basic-til...
Thanks a lot for the time and effort you put into making those!
Last thing to note is that, even if I set a timer and I kept updating the target position, that part was not put into evidence very much, as the target I created was not moving. However, if I had a moving target, the path would have been recreated to follow the new position.
Around 9:41 move_and_slide() in contrast to move_and_collide(), does not require a vector which is pre-multiplied by delta, as it is taken into account already. Thanks @Limited_Film_Works_ for pointing that out.
--------------------
Github repository for this project:
github.com/cashew-olddew/godo...
Support me on Ko-Fi: ko-fi.com/cashewolddew
--------------------
#godot #gamedev #pathfinding

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

 

2 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 107   
@cashewolddew
@cashewolddew 5 месяцев назад
Hello everyone! I've been blown away by your response to this video. I did not expect this. I am very thankful! I have decided to create a repository for future tutorials in order to give you the option to directly copy the projects from there. For this video, the project can be found here: github.com/cashew-olddew/godot-tutorials/tree/main/4.2/1%20-%20tilemap%20pathfinding
@gaetanjacquemin526
@gaetanjacquemin526 5 месяцев назад
DUDE! I can't tell you how much your video was helpful to me: I have been struggling for WEEKS to make navigation work properly with Tilemaps. I could not find any helpful insight anywhere. Your video popping in my feed was litterally a Chrismtas miracle!! THANK YOU SO MUCH
@cashewolddew
@cashewolddew 5 месяцев назад
I'm really glad it helped you! Happy holidays!
@tylerdavault9604
@tylerdavault9604 3 месяца назад
Man, im still stuck on trying to call animations from my animation tree 😅😅😅
@cashewolddew
@cashewolddew 3 месяца назад
@@tylerdavault9604 Don't worry, it gets easier! Here's a peanut 🥜
@juliap.5375
@juliap.5375 26 дней назад
Weeks? 😮 for that time it is possibly to write own layer of graphics to replace whole godot for own code. And as result to spend 30 mins to write path-finding algorithm.
@cashewolddew
@cashewolddew 26 дней назад
@@juliap.5375 While that might be possible for an experienced developer, I think it's important to encourage each other in the learning process. To be honest, I also had moments in my programmer journey in which I spent way more than I should have on a subject and I do not regret it, as it was a huge step towards honing my skills and becoming a better programmer. 🥜
@Ryxbar
@Ryxbar 14 дней назад
This was SO useful, and very well-explained. Great job, homie, and thank you!
@cashewolddew
@cashewolddew 14 дней назад
Thanks a lot! 🥜
@brett6759
@brett6759 4 месяца назад
Great video, I think you have a real talent for explaining clearly without dumbing it down too much. As is evident by the comments your content is appreciated. Good luck on your youtube journey.
@focusedphoenixgames6700
@focusedphoenixgames6700 28 дней назад
I've been struggling with this for a couple days now and your tutorial worked quite nicely!
@cashewolddew
@cashewolddew 28 дней назад
Glad it helped! 🥜
@nahruz.w3044
@nahruz.w3044 3 месяца назад
I love the fact that youtube algorithm know what kind of game im making that by now, and got recommend your video. Thanks for uploading btw, hope you channel will grow bigger👍🏻
@cashewolddew
@cashewolddew 3 месяца назад
Thanks a lot for the support! 🥜
@Inuzika
@Inuzika 3 месяца назад
what an extremely powerful tool, thanks for the major insight !
@jshxb14
@jshxb14 5 месяцев назад
thank you so much for making this video. i was able to make a simple code for an enemy in my game project ❤
@reesensix9755
@reesensix9755 3 месяца назад
Thank you! I saw maybe 10 tutorial on how to make a pathfinding but no one of these tutorial is for godot 4.2. You saved my life
@cashewolddew
@cashewolddew 3 месяца назад
You are very welcome! :D
@Erfan_Al
@Erfan_Al 5 месяцев назад
this video was actually quite useful for me... got a new sub! pls make more tutorials on godot tips & tricks!
@cashewolddew
@cashewolddew 5 месяцев назад
Thank you for the kind words. Will make sure to do more ^^
@Someone-tc4wu
@Someone-tc4wu 3 месяца назад
Very helpful and well explained!
@nikooo042
@nikooo042 5 месяцев назад
Thanks this has been very useful. I've been using NavigationAgent's Avoidance cause didn't know how to bake the obstacles within the polygon heheh
@j-kevinampong1379
@j-kevinampong1379 5 месяцев назад
Damn I learned a lot from this tutorial, you got my sub for sure and thank for the wonderful tutorial ❤
@cashewolddew
@cashewolddew 5 месяцев назад
I'm happy to hear that! Thanks a lot! 🥜
@darkcatsup1323
@darkcatsup1323 5 месяцев назад
Really need this one, thanks!
@danielhuayta4434
@danielhuayta4434 2 месяца назад
u are my hero, TYVM
@signoraw
@signoraw 5 месяцев назад
Thank you so much!
@betterine
@betterine 5 месяцев назад
Brilliant tutorial! Wonderfully explained. Only one issue - it seems the collision between the enemies and the fence doesn't work. In other words something seems to be going wrong with layers that you mentioned at the 15:00 mark. Any thoughts why this might happen?
@cashewolddew
@cashewolddew 5 месяцев назад
Thank you for the kind words! Have you made sure that the collisions are in layer 0? Currently, it only works that way. See 16:44 and this github.com/godotengine/godot/pull/80796#:~:text=TileMap%20navigation%20mesh%20baking. Hope it helps you!
@martinithechobit
@martinithechobit 5 месяцев назад
Thank you. I have issues as well with the latest build.
@cashewolddew
@cashewolddew 5 месяцев назад
Ha ha, it's better if we struggle together 😅
@philly2548
@philly2548 4 месяца назад
Please tell me that this is going to be an ongoing series...your tutorials are so helpf
@cashewolddew
@cashewolddew 4 месяца назад
I'm really happy to hear your feedback! I want to make more tutorials. I actually added one just yesterday 🥜
@HampterLover985
@HampterLover985 5 месяцев назад
This was super helpful, thanks! Though it would be nice if it considered all layers of the tilemap and not just the top most one ;P
@cashewolddew
@cashewolddew 5 месяцев назад
Ha ha, I know what you mean! I also thought the same thing, especially since the 'layer 0' detail can be easily overlooked. However, the good news is that they have in plan to adjust this eventually: github.com/godotengine/godot/pull/80796#issuecomment-1689234510 I'm happy I was able to help you! 🥜
@iakobs
@iakobs 4 месяца назад
Hey! very helpful video, thanks a lot! Do you really need the NavigationRegion, though? If I'm using a navigation layer painted into my tiles, that's also working fine for me.
@cashewolddew
@cashewolddew 4 месяца назад
Thanks for the kind words! Were you using multiple layers while designing your tilemap? At the moment of making the video I had some problems making it work with the navigation layer of the tiles. I'd be glad to find out there's a better way of doing this! Thanks for letting me know. I will explore it more!
@iakobs
@iakobs 4 месяца назад
@@cashewolddew I'm actually having problems with layers, but as far as I keep all navigation tiles in layer 0 of the tilemap, it looks like it's working. I'm now struggling to make the agent follow the path "more strictely" but I think that's just a configuration problem. Reading through the docs right now :)
@cashewolddew
@cashewolddew 4 месяца назад
@@iakobs If what you're looking for is a way to strictly follow a Tilemap grid, I also touched that subject in this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OMrDS0zlr-k.html
@iakobs
@iakobs 4 месяца назад
@@cashewolddew you're god tier! thanks!
@dlandsvolka4046
@dlandsvolka4046 2 месяца назад
nice tutorial
@Korn1holio
@Korn1holio 3 месяца назад
Thank you very much for the tutorial. I must say though, that the Tilemap + Navigation integration looks really poor as of now - lots of unintuitive actions are required.
@lwl3788
@lwl3788 5 месяцев назад
Sensei! Thanks
@The_K1tten_Earter
@The_K1tten_Earter 5 месяцев назад
Is it possibe to do this while using a moving KinematicBody2D as the obstacle?
@cashewolddew
@cashewolddew 5 месяцев назад
If you're thinking about navigation polygon recalculation based on the position of the KinematicBody2D at runtime, you can bake it with the bake_navigation_polygon method: docs.godotengine.org/en/latest/classes/class_navigationregion2d.html#class-navigationregion2d-method-bake-navigation-polygon However, I'm not sure if this would be the best solution for your problem
@abradotcs
@abradotcs 5 месяцев назад
Cool!
@user-hx4hg1sf5g
@user-hx4hg1sf5g 3 месяца назад
谢谢,讲得很清晰
@cashewolddew
@cashewolddew 3 месяца назад
不客气 🥜
@robinvandervegt3422
@robinvandervegt3422 3 месяца назад
Thanks , the only problem I have is that I have a moving obstacle2d but it doesn’t get avoided (and yes it is enabled and good layers and masks) any tips?
@cashewolddew
@cashewolddew 3 месяца назад
My guess is that the obstacle does not get avoided because the area does not get recalculated based on the new position of the obstacle at each frame. There are ways to programmatically regenerate the NavigationArea2D, but it's to be seen in practice how much that would affect your performance. Another possibility would be to have a different functionality for the avoidance of the moving obstacle. For example, I'm thinking you could have an Area2D on your obstacle and when your character enters that area runs a script which makes it move away from the obstacle. I haven't tested these yet, but they should be good starting points. I'm sure that you'll manage to find a solution after some exploring! Hope that helps! 🥜 ^_^
@k4gi
@k4gi 5 месяцев назад
thank you :)
@dailyfunnytv358
@dailyfunnytv358 3 месяца назад
can you bake programatically? so that we can do dynamic tilemap editing for positioning walls or breaking blocks
@cashewolddew
@cashewolddew 3 месяца назад
I saw a similar question recently. If you have the polygon set, you can bake it with the bake_navigation_polygon() method. See more here for other functions you might need: docs.godotengine.org/en/stable/classes/class_navigationregion2d.html#class-navigationregion2d-method-bake-navigation-polygon However, if you want to be able to do pathfinding easier, in case you are working with a precise tilemap, you could use Astargrid2D. I also have a pretty recent video covering that topic.
@FelinaFaerlaingal
@FelinaFaerlaingal Месяц назад
I got most of it to work, except one thing: when I bake the navigation with a polygon that surround my tilemap (it's a dungeon tilemap, so I drew the rooms and I want to navigate inside them) it generate traversable zones Outside the rooms. The rooms are not covered in blue at all. I don't understand how to tell it to also calculate the inside of the rooms. I did the navigation layer of the tilemap, selecting all the inside bits of the tiles to mark them as navigable spaces. I dunno if I'm super clear, I can send some screenshots maybe?
@cashewolddew
@cashewolddew Месяц назад
What you wrote is actually very clear. Great job! To be honest, I never tried generating a navigation area on an enclosed region. I'll have to try it out myself before I can say for sure.
@cashewolddew
@cashewolddew Месяц назад
ACTUALLY, I remember now that I did that. I did it in the video at the 19:39 minute. As you can see, the area is enclosed, but the navigation area is generated. One thing to bear in mind is the order in which you draw the nodes. For example, here github.com/godotengine/godot/pull/80796#issuecomment-1721091034 someone said that regions weren't properly drawn when putting the region nodes in a Clock-wise order. Try putting them counter clock-wise. Hope this helped! 🥜
@pichitosmalltown3239
@pichitosmalltown3239 5 месяцев назад
how would you go about using navigation regions with an automatically generated world?
@cashewolddew
@cashewolddew 5 месяцев назад
I think I would look for a way to dynamically bake the map once it is generated. I see in the docs that there is a bake_navigation_polygon method which could be called in your scripts: docs.godotengine.org/en/stable/classes/class_navigationregion2d.html#class-navigationregion2d-method-bake-navigation-polygon
@goncalocascais
@goncalocascais 14 дней назад
the idea behind the video works flawlessly, but I have an issue. On my testing project I have a layer for walls and another for decorations (that have collision shapes as well) and right now I can only get the pathfinding to work when setting the walls to the top spot of the layers (as the video explains and this works flawlessly). The issue comes when I want to have pathfinding to take into consideration the objects that are scattered around the map as well. Right now, my enemies get stuck on this objects. Is there any workaround for this? Great video btw mate :)
@cashewolddew
@cashewolddew 14 дней назад
Indeed, as you noticed, this is currently a limitation. I heard there will be some more features coming regarding pathfinding and Tilemaps in Godot 4.3. However, until then, maybe you could try finding all elements on that layer and remove the navigation from there? I did a similar trick in this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yT22SXYpoYM.html Hope this helps you!
@goncalocascais
@goncalocascais 14 дней назад
@@cashewolddew Thanks for the video, ill give it a look! and tysm for the quick answer, as someone who is brand new to gamedev its videos like this that make or break my newbie experience ❤
@goncalocascais
@goncalocascais 14 дней назад
@@cashewolddew IT WORKED! This is an amazing workaround and seems to work flawlessly. On your example you used code on the tilemap for just one layer, but I can add as many layers as I want to it just by using "or" if coords in get_used_cells_by_id(2) or coords in get_used_cells_by_id(1): this is line 4 at 23m32s on the other video! its working flawlessly now tysm :D
@cashewolddew
@cashewolddew 14 дней назад
@@goncalocascais I'm very happy you did it! Hopefully these comments will also help others. 🥜
@paulkoch7439
@paulkoch7439 4 месяца назад
Any idea how to bake the NavigationRegion2D at runtime?
@cashewolddew
@cashewolddew 4 месяца назад
If you have the polygon set, you can bake it with the bake_navigation_polygon() method. See more here for other functions you might need: docs.godotengine.org/en/stable/classes/class_navigationregion2d.html#class-navigationregion2d-method-bake-navigation-polygon
@Limited_Film_Works_
@Limited_Film_Works_ 3 месяца назад
isn't delta applied automatically in the move and slide function? I wonder if it's necesary to apply that to velocity when moving the enemy
@cashewolddew
@cashewolddew 3 месяца назад
You are correct! move_and_slide does take delta into account so having it in our calculations doesn't make sense. Thanks for pointing that out. This shouldn't affect the overall scope of the tutorial, but I'll make sure to that watchers aware of that error.
@Limited_Film_Works_
@Limited_Film_Works_ 3 месяца назад
@@cashewolddew I mean, yeah. I'm telling you because I used to do it. I've been enjoying watching your videos, man. Keep it up.
@cashewolddew
@cashewolddew 3 месяца назад
@@Limited_Film_Works_ Really appreciate it!
@noise_dev
@noise_dev 26 дней назад
Dude your tutorial is great and I thought I can use it with an issue I am facing in my project but unfortunately not. Either way maybe you know how I could face my problem? I have an issue with the navigation agent. I have created an enemy node, added a navigation agent node to it, set up everything and the enemy is chasing the player which is making everything work 90% good. The 10% is that it is getting stuck on trees in the map. My map has 2 layers: 1st, the base one is grass or a walkable surface where I have added a navigation layer for the nav agent 2nd layer is set on top of the 1st layer and those are different obstacles like for example trees. Can I somehow define in the navigation agent to avoid the second layer when calculating the path? My map has trees with defined collisions and my navigation agent has avoidance set for the same layers as tree collisions. No idea why it doesn't work as desired. I think I can't add navigation area to my enemy node becouse I am planning to make my maps randomly generated so i just prefer to trigger navigation and chase player around as long as he is in the chase proximity of my enemy. Any idea how or what I could do? Discord is not helping this time 😢
@cashewolddew
@cashewolddew 26 дней назад
Are you using NavigationObstacles docs.godotengine.org/en/4.0/tutorials/navigation/navigation_using_navigationobstacles.html for avoidance? That could help. Otherwise, if the trees do not move (I hope trees don't move 😀), maybe you could define them in a similar fashion to what I did for the fence in this tutorial. Hope this helps at least a bit!
@noise_dev
@noise_dev 26 дней назад
@@cashewolddew I will check navigationobstacles and if not I will just use your solution :) thanks for the reply man
@noise_dev
@noise_dev 24 дня назад
@@cashewolddew oh god. I am blind :D Seems like I haven't payed too much attention to your description but now I see that exactly this is what I need and this is the best suitable idea for me! Hours wasted because of my lack of attention :D Thanks for this video!
@cashewolddew
@cashewolddew 24 дня назад
@@noise_dev Happens to the best of us! 😄
@Dmitriy15486
@Dmitriy15486 3 месяца назад
Hi, friend! Tell me, why when the enemy reaches the goal, he does not stop, but trembles? How can this be resolved using pathfinding settings?
@cashewolddew
@cashewolddew 3 месяца назад
This generally happens because the pathfinding nodes are trying to generate closer and closer to your target, never quite reaching it. One way to avoid this would be adding a threshold which, once reached, stops the enemy (or swaps it from moving to attacking state). You can achieve that with 'distance_to'. If the distance from the enemy to your character is less than a set threshold (say, 10 units), then you simply don't run the pathfinding code anymore. Here's the same question asked by someone. forum.godotengine.org/t/how-do-i-stop-nodes-from-shaking-with-navigationagent2d/102/2 Hope this helps! ^_^
@The_Soup_Master
@The_Soup_Master 3 месяца назад
I'm using a CharacterBody2D as the target instead and every time I save the scene it erases "target" from the inspector to the side and navigation doesn't work. It's still exported in the script. Is there something wrong with using CharacterBody2D as the target? Edit: I don't know for sure that this was the issue, but I use VS code as an external editor and I switched from 4.1 to 4.2 for the nav updates. Something was going on where Godot had the old enemy script within the editor but VS code had the updated script. Somehow it was mixing everything up between the 2 and when saving it would read the script from the internal editor rather than the external. So stupid and unnecessary.
@cashewolddew
@cashewolddew 3 месяца назад
I'm happy you quickly found a fix. Good job! 🥜
@deakattila
@deakattila 2 месяца назад
Is it possible to do all this from code? What I want to do is to spawn a lot of enemys continuously, automatically get the path to travel on , and when they reach the destination they despawn
@cashewolddew
@cashewolddew 2 месяца назад
If you do not mind making them follow a grid, I have a video which does the most functionality from code: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-OMrDS0zlr-k.html However, if you want to keep the same behavior as in this video, then most of the documentation for navigation can be found under: docs.godotengine.org/en/stable/tutorials/navigation/navigation_introduction_2d.html or in the description of this video. There are usually code equivalents for all possible actions done in the editor. Let me know if you need help with anything! 🥜
@deakattila
@deakattila 2 месяца назад
​@@cashewolddew Thank you, I will watch your video. I only started working in Godot yesterday, so I only know a few things. And I have never worked in any game engine before. So if I'm stuck, I just look up videos and find a proper tutorial for it.
@cashewolddew
@cashewolddew 2 месяца назад
@@deakattila It's so great to hear that you started with this. It might not always be easy, but make sure to keep it up and you'll manage to make good games!
@dreadge
@dreadge 3 месяца назад
is there a way to make the pathfinding avoid open areas and be restricted to near walls?
@cashewolddew
@cashewolddew 3 месяца назад
I'm not really sure what you mean by open areas, but if you want to follow the path close to the walls, there is a neat setting a NavigationAgent2D has for path post processing: docs.godotengine.org/en/stable/classes/class_navigationpathqueryparameters2d.html#enum-navigationpathqueryparameters2d-pathpostprocessing
@dreadge
@dreadge 3 месяца назад
im trying to make a wall crawler type pathfinding@@cashewolddew
@cashewolddew
@cashewolddew 3 месяца назад
@@dreadgeIn such a case I would define his walkable area to only be the walls
@JuddGledhill
@JuddGledhill 2 месяца назад
I think I am a bit lost. I thought you could do all the navigation in the tilemap instead of needing that additional region node to make it all come together. Is that incorrect?
@cashewolddew
@cashewolddew 2 месяца назад
I thought the same thing, especially since a Tilemap has navigation layers. However, when I tried to do exactly that I stumbled upon a lot of troubles. This was actually the reason I made this video. I tried so hard to make things work that I didn't want anyone to go through that again :D I added some notes in the description regarding those issues and some discussion on Github. I'm actively checking this and if I find that an issue is fixed or that I was not doing something properly, I'll make sure to come with an update!
@JuddGledhill
@JuddGledhill Месяц назад
Wow. So what do those navigation layers do in the tile map..?
@JuddGledhill
@JuddGledhill Месяц назад
@@cashewolddew I am working on something now and the stars aligned. I am using the tilemap with nav layers and it is working! If you want it, I can share. LMK.
@cashewolddew
@cashewolddew Месяц назад
@@JuddGledhill I'd be really interested to know. Please write to me on any of my social media! Thanks!
@nameisnotdan
@nameisnotdan Месяц назад
​@@JuddGledhill I'd also be interested. Was attempting to learn and use the navigation layers, struggled a bit, learned Godot 4.2 added some changes, and am now in a rabbit hole lol. This video is great, btw. Thank you.
@vader9133
@vader9133 5 месяцев назад
For some reason Godot 4 doesn't work with my Nvidia graphics card. Do any of these features not exist in versions before 4.0
@cashewolddew
@cashewolddew 5 месяцев назад
If I remember well, tilemap layers were not a thing in godot 3.x. This would probably imply that the navigation baking for the tilemap does not work as well, as there would be no concept of 'layer 0' without layers. I hope you get the Nvidia graphics problems fixed. I'm not sure if it would help, but try checking that you also have the latest drivers for your graphics card.
@customdevvv
@customdevvv 5 месяцев назад
Try updating your drivers, that worked for me atleast
@Korn1holio
@Korn1holio 3 месяца назад
Another thing I wonder, why did you to go through all the steps of using a "NavigationRegion2D", when you could simply create a navigation layer in the Tileset, and add all walkable tiles to it? It works so much simpler, and you don't need to parent the Tilemap to the Region, Bake navigation etc. Or I am missing something?
@cashewolddew
@cashewolddew 3 месяца назад
That's actually the whole reason I made the tutorial. I expected things to work a simple as you wrote here: Put a navigation layer into the Tileset, add all walkable tiles to it. However, this was not the case. I think I spent a week or so looking for a reasonable explanation or alternative. After I managed to come up with a solution, I wanted to show it to others so they don't have to go through the same pain 🥜 However, I could revisit the topic in a future video if things get simplified or changed.
@Korn1holio
@Korn1holio 3 месяца назад
@@cashewolddew thank you for the response. Maybe I'm mistaken. But navigation absolutely works for me without NavRegion or baking. Here's my enemy code (as mentioned, the Tileset has the walkable tiles added to the navigation layer, of course): extends CharacterBody2D @export var speed := 50 @export var nav_agent : NavigationAgent2D var target : Node2D var home_position : Vector2 func _ready(): nav_agent = $NavigationAgent2D home_position = self.global_position nav_agent.path_desired_distance = 4 nav_agent.target_desired_distance = 4 func _physics_process(_delta): if nav_agent.is_navigation_finished(): return var axis = to_local(nav_agent.get_next_path_position()).normalized() velocity = axis * speed move_and_slide() func recalculate_path(): if target: nav_agent.target_position = target.global_position else: nav_agent.target_position = home_position func _on_recalculate_timer_timeout(): recalculate_path()
@Korn1holio
@Korn1holio 3 месяца назад
@@cashewolddew I see. I've dug into the problem a bit deeper and... looks like one can totally make Navigation work with just a navigation layer, however you won't be able to use layered tilemaps, which is obviously unacceptable. So only single layered tilemaps are supported without baking... too bad. Which is, incidentally, what you've already written in the video description, I should have been more attentive :)
@cashewolddew
@cashewolddew 3 месяца назад
@@Korn1holio No worries! You did great by writing about it. If there are better or more ways to do things I'm really happy to find out about them.
@Korn1holio
@Korn1holio 3 месяца назад
@@cashewolddew thanks! Yes, I am looking for more ways to do it, since the approach with NavRegion2D, while definitely working, looks a bit too 'manual' or complex to implement for procedurally generated or streamed tilemaps. Will post any updates.
@raidev_
@raidev_ 5 месяцев назад
why would it require the collision to be in layer 0 and the region to be the parent of the tilemap? It's so arbitrary and implanting this would break my game
@cashewolddew
@cashewolddew 5 месяцев назад
There also is an option to have the tilemap added to a group and then specify the group in the Geometry Source Group Name field of a navigation polygon from a navigation region 2d. Regarding layer 0, from the discussions I attached in the description, it looks like it is subject to change later on, but for now, that's how it is, sadly.
@martinithechobit
@martinithechobit 5 месяцев назад
My baking does not always bake close enough.
@cashewolddew
@cashewolddew 4 месяца назад
Hello! Sorry for missing your comment. What do you mean by that? Is the generated region too small? Try checking if making the navigation polygon larger would help.
@martinithechobit
@martinithechobit 4 месяца назад
@cashewolddew yes yes the generated region is always smaller than the area I selected. But I got it now thanks.
Далее
Automatically zoom camera to a Tilemap in Godot 4.2
36:58
Advance Enemy AI in Godot
8:17
Просмотров 17 тыс.
Godot... But Prettier
11:23
Просмотров 82 тыс.
How Games Make VFX (Demonstrated in Godot 4)
5:46
Просмотров 299 тыс.