Тёмный
No video :(

3D Pathfinding in Godot using Navigation Mesh 

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

Learn how to add 3D Pathfinding in Godot using Navigation Mesh in your projects by following this simple Godot tutorial.
You'll learn how to move a KinematicBody using the Navigation and NavigationMesh nodes in Godot. You could use this technique in a number of different games, for example an RTS or MOBA in Godot where you click to move around the map, or for controlling enemy pathfinding AI in Godot.
---
Patreon: / codewithtom
Discord: / discord
Twitter: / codewithtom
Github: github.com/cod...

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

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@greg7987
@greg7987 2 года назад
A clear, simple and amazing video for learning 3D pathfinding in Godot it is.
@CodeWithTom
@CodeWithTom 2 года назад
Thank you Greg I appreciate that.
@Gabirell
@Gabirell 2 года назад
Man… I was asking myself how this is implemented… (I’m a totally curious noob) and this seems so logic… saved for when I learn enough to understand it all. 🙏 thanks!!!
@Crisisdarkness
@Crisisdarkness 2 года назад
Wow, you came back with a great tutorial, thanks Tom
@CodeWithTom
@CodeWithTom 2 года назад
Thank you I really appreciate it!
@zyxoto1264
@zyxoto1264 2 года назад
The legend is back
@CodeWithTom
@CodeWithTom 2 года назад
Haha thank you, good to be back!
@__Rizzler__
@__Rizzler__ 2 года назад
Broo thank you. 🙏🙏🌹❤
@CodeWithTom
@CodeWithTom 2 года назад
You're very welcome :)
@tjspeirs75
@tjspeirs75 6 месяцев назад
Great video! Am I right in thinking that that navigation code could be sectioned off into it's own script and used as a component? And then that component could just be dropped onto anything that needs it? Seems like it'd work great!
@p.w.5813
@p.w.5813 2 года назад
Thanks for that tutorial, but I still have a problem. My map is not flat like yours, it has hills and valleys. Is there a way to use path finding in such conditions?
@IMidgetManI
@IMidgetManI 2 года назад
He's back
@CodeWithTom
@CodeWithTom 2 года назад
Glad to be back :)
@PunyFlash
@PunyFlash 2 года назад
The ray is colliding with the collision shape of the kinematic body
@malcolminthemetal4992
@malcolminthemetal4992 Год назад
This is great. Thank you very much.
@wexordante
@wexordante 6 месяцев назад
I can't search tutorial about turn-based strategy movement in 3d. If you can, pleace, say me what I should or create a tutorial in your chanel. Thanks )
@chrisspamtest
@chrisspamtest Год назад
Anyone got this to work? Nothing happens when I mouse click.
@Alternalo
@Alternalo 2 года назад
What happens when you click on the top of the smaller cubes?
@Ceisriel
@Ceisriel Год назад
is navmesh as useless as gmesh? in the sense it's only for demos or can you use that with actual 3d terrain sculpted in blender?
@zapman6528
@zapman6528 Год назад
The code: extends KinematicBody export var speed = 10 onready var camera = $"../Camera" onready var navigation = $"../Navigation" var space_state : PhysicsDirectSpaceState var path = [] var path_index = 0 func _ready(): space_state = get_world().direct_space_state func _input(event): var mouse_event = event as InputEventMouseButton if mouse_event == null: return if mouse_event.pressed and mouse_event.button_index == 1: var from = camera.project_ray_origin(mouse_event.position) var to = from + camera.project_ray_normal(mouse_event.position) * 1000 var result = space_state.intersect_ray(from, to) if result.collider: path = navigation.get_simple_path(global_transform.origin, result.position) path_index = 0 func _physics_process(delta): if path_index < path.size(): var direction = path[path_index] if direction.length() < 1: path_index += 1 else: move_and_slide(direction.normalized() * speed)
@mounaimchakroun6923
@mounaimchakroun6923 2 года назад
Thank you so much
@projectavalongame
@projectavalongame 2 года назад
Hey mate thanks for the tutorial. Could you do a tutorial on making the character face towards the direction they are moving? I use the look_at function but it will look directly at where I clicked, so they will do a crab walk around an obstacle (move sidways while looking directly at the mouse click rather than the direction they are moving.)
@Pirochiro
@Pirochiro Год назад
Not sure if you figured this out but you if you look at direction instead of the target, the player will always look in the direction they are moving.
@ericomfg
@ericomfg Год назад
Where does global_transform come from?
@thimkthimk
@thimkthimk 11 месяцев назад
It's the position of the node in world space. KinematicBody (now CharacterBody3D in Godot 4) inherits from Node3D and therefore can use it's properties, like global_transform.
@al-oh8fq
@al-oh8fq 2 года назад
would it work with non static obstacles (like moving walls for example)?
@bronxzoo8344
@bronxzoo8344 Год назад
nobody has anything that will help with enemy facing the player with navigation, Cane you help. Thank you.
@zapman6528
@zapman6528 Год назад
Make the enemy model a child of the kinematic, then through code have the model face the player. I cant help with the code part but thats how you'd have to organize it.
@coder-serwin3545
@coder-serwin3545 2 года назад
Bro can you make this with enemy that wants to follow player please
@CodeWithTom
@CodeWithTom 2 года назад
Good suggestion :)
@coder-serwin3545
@coder-serwin3545 2 года назад
@@CodeWithTom :)
@Arun--AK
@Arun--AK 2 года назад
Start a new series to make TPS game bro
@CodeWithTom
@CodeWithTom 2 года назад
I'd love to make a series on making a TPS, it's definitely on my list of things to cover.
@p.w.5813
@p.w.5813 2 года назад
Thanks for that tutorial, but I still have a problem. My map is not flat like yours, it has hills and valleys. Is there a way to use path finding in such conditions?
@Ceisriel
@Ceisriel Год назад
did you figure it out I'm asking everywhere and no one can answer
@p.w.5813
@p.w.5813 Год назад
@@Ceisriel sorry mate, I didn't
@Ceisriel
@Ceisriel Год назад
@@p.w.5813 fortunately I did, you have to put your terrain mesh under the navmesh node, and if you can't do that, you right click on the main node of the terrain, and select "change type" you change it to navmesh and then click the bake mesh button , and then you need to re add all the collisions. It's very inefficient, slow and pretty much useless because if your terrain has more than 4k polygons the game engine starts to freeze or crash as it is baking
Далее
How to make a game when your art sucks!
3:41
Просмотров 6 тыс.
Godot 4 3D - AI Pathfinding/Navigation
10:15
Просмотров 66 тыс.
C’est qui le plus fort 😂
00:18
Просмотров 1,4 млн
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
Просмотров 511 тыс.
Now anyone can simulate flow for a 3D printer duct
11:17
I Built a Transparent Boomerang (it's lethal)
13:10
Damascus Steel From Stick Welding Electrodes
14:15
Просмотров 661 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 553 тыс.
I Tried To Beat Minecraft Backwards
18:53
Просмотров 1,4 млн
INVENTORY & ITEM SYSTEM in Godot
50:30
Просмотров 56 тыс.
The biggest lie in video games
15:18
Просмотров 1,8 млн