Fix Navigation Agents Stuck on TileMap Corners in Godot 3.5

Поділитися
Вставка

КОМЕНТАРІ • 35

  • @thecolorblue7427
    @thecolorblue7427 Рік тому +23

    for anyone on godot 4, you need to turn on advanced settings to see Navigation 2D Option in the settings by the way

  • @Korn1holio
    @Korn1holio 8 місяців тому +3

    It's utterly absurd how this 'feature' takes years to fix. It's almost March 2024 and in Godot 4.2 'wall clinging' is still a problem, that's taken me almost a day to research, and we're still have to do with hacks. Thank you for the solution, and sorry for ranting.

  • @malkaaz5199
    @malkaaz5199 10 місяців тому

    I may be late to this, but if you do this and also put the terrain in a layer that is not included in the thing-getting-stuck's mask, it will still pathfind correctly because it "knows" not to go though walls and will not collide with them if it gets too close.
    For example, if the wall is in layer 1 you disable mask 1 in the thing. The wall would still be able to interact with other stuff, you just need to enable mask 1 in the things you want the wall to interact with.
    Also, you can change masks and layers in script, so if you need to make the thing collide with the wall you can enable and disable it as much as you want.

  • @realMenta
    @realMenta 2 роки тому +2

    Thank you, tried doing this but I was unsuccessful, didn`t knew about this merging Edge Connection parameter, really useful!

  • @chadwilliams4373
    @chadwilliams4373 Рік тому +2

    Thanks mate, I just had this issue in Godot 4. You saved me many, many hours of frustration!

  • @nvvv_
    @nvvv_ Рік тому +1

    thank you this was driving me insane and i couldn't find a workaround

  • @KlausWulfenbach
    @KlausWulfenbach 2 роки тому +8

    This is exactly what I needed. Much appreciated.

  • @feedmind4669
    @feedmind4669 Рік тому +6

    why is it shaking?

  • @fonkinstubbleduck9163
    @fonkinstubbleduck9163 Рік тому +2

    Thank you. Been looking for this for 3 months

  • @Marduk401
    @Marduk401 2 роки тому +6

    so what happens if you have a character with a bigger colision shape? this fixes nothing. (not blaming you by the way, i just dont understand why the implemented it like this, its very buggy and basically still useless for commercial use.)

    • @FirebelleyGames
      @FirebelleyGames  2 роки тому +1

      This is indeed a problem unfortunately

    • @MaFFaKa
      @MaFFaKa 2 роки тому

      I decided to make navigation polygons manually, if you found a better solution please let me know.

    • @Marduk401
      @Marduk401 2 роки тому +1

      @@MaFFaKa i have implemented my own navigation system for now. it works great, wont use godot's anytime soon. it took me one week to have this system up and working.

    • @Korn1holio
      @Korn1holio 8 місяців тому

      @@Marduk401 yeah, godot's nav system is huge steaming POS, unfortunately. Still there a year later.

  • @lyingpancake95
    @lyingpancake95 Рік тому +1

    Concise and very helpful thank you!

  • @rudy_kolibri
    @rudy_kolibri 2 роки тому +1

    Hi could you make a nice and easy followup off youre bullet turtorial, like how that you can make a shotgun type of shot etc

  • @intevolver
    @intevolver Рік тому

    Is there a way to disable the diagonal cut made at corners?

  • @menitoon
    @menitoon Рік тому +2

    i tried doing that with a 16x16 tile (I set the merging Edge Connection parameter to 8)but It doesn't seem to work,Could you please help me ?
    Thanks :D

    • @mgomezmunoz92
      @mgomezmunoz92 Рік тому

      same issue, did you fix it?

    • @menitoon
      @menitoon Рік тому

      @@mgomezmunoz92 I found an alternative basically what I do, is I make an auto-tile with navigation2D collisions except they aren't directly touching edges if that makes sense

  • @Owner2323
    @Owner2323 Рік тому

    I tried this and my character stopped moving all together. Can you please help?

  • @g0ldhat55
    @g0ldhat55 2 роки тому +2

    what a simple fix thank you :)

  • @decoy3641
    @decoy3641 2 роки тому +2

    Great Tutorial! ❤

  • @jay-tbl
    @jay-tbl Рік тому

    Tried this in Godot 4, different process but similar idea, setting the project setting to combine the polygons. But the problem is when the target is outside of the navigation polygons (in between the gaps), the agent thinks it cannot navigate to it. Is there a fix?

    • @denisyu2632
      @denisyu2632 Рік тому

      try increasing the target desired distance of the agent

  • @ariton2990
    @ariton2990 Рік тому +1

    This is great. But in Godot 4 no matter what I do, enemies still get stuck sometimes unless I give them absolutely tiny collision shape. Have you figured something better that works for Godot 4?

    • @FirebelleyGames
      @FirebelleyGames  Рік тому +1

      Unfortunately no, this is the best I have come up with for this problem.
      Actually, if your levels are static and not randomly generated, you can just manually create large navigation polygons yourself, and be sure to define them such that there's a good amount of space between the navigation polygon and any terrain.

    • @ariton2990
      @ariton2990 Рік тому

      @@FirebelleyGames yup thats what i did and it works now.

    • @stephenharperisgay
      @stephenharperisgay Рік тому

      The navigation polygons are much easier to deal with than tilemap navs for sure, and the overall pathfinding is smoother because of the way the polygons are divided.
      Might look into automating NavRegion2D creation for tilemaps. Would be nice to just be able to pick a margin of distance from from the ground layer, and fill in the polys where there are background layers.

  • @1gengabe
    @1gengabe 2 роки тому +1

    Tileset navigation is not as good as having a large single navigation polygon, I have done some testing with a vampire survivors like game and there is a clear difference between tilemap and single polygon navigation.

    • @FirebelleyGames
      @FirebelleyGames  2 роки тому

      That makes sense, but TileMap navigation is often more sensible particularly for complicated tilemaps with lots of obstacles.

    • @1gengabe
      @1gengabe 2 роки тому +1

      @@FirebelleyGames true but I think you can cut holes into navigation polygons. Granted for fast prototyping tile maps are great, but it can’t handle more the 25 AIs before frame loss, where a single polygon didn’t have any or barely noticeable frame loss even when getting close to 200+ AIs.

    • @1gengabe
      @1gengabe 2 роки тому

      I also didn’t know about the merge distance option though, so I should probably do more testing.

  • @TheThejokekid
    @TheThejokekid Рік тому

    wouldnt using circular collissions also fix this issue? or is it not using move_and_slide to move around?

    • @peto348
      @peto348 Рік тому

      I'm using circular collider and I still have this problem. I'm using safe velocity (for obstacle avoidance) driving the CharacterBody2D velocity and as the character approaches the corner, the velocity vector approaches perpendicular direction to the wall character is still sliding on. It ends up stuck with center of circle aligned with the corner, pushing perpendicularly to the wall and not moving.