#Click to move pathfinding

21 messages · Page 1 of 1 (latest)

fallow hill
#

So I followed a tutorial on how to make a click to move system and it works but even on my small canvas with 1 cube in the middle whenver my character in in front of the cube it cant find a way past it. Since I see this uses A* I assume there is some sort of setting I am missing and that is why it can't find a path past it

#

this is what it looks like and when I click in front of the cube my "character" cannot get past it

gusty spear
#

What do you use for pathfinding. A navigation mesh or AStar3D?

fallow hill
#

navmesh I think

gusty spear
#

turn on the navigation mesh debug that you can find in the "Debug" menu of the Editor with "Visible Navigation" to see the navigation mesh.

fallow hill
#

these are the nodes

gusty spear
#

and if there is navigation mesh below your box that is why it can not find a way around it.

fallow hill
#

ohhhhhh

fallow hill
#

or do I just need to not use objects like that to work with a mesh?

gusty spear
#

navigation mesh is for static level geometry. You can recreate it when things change but it is not for changing it every frame with stuff moving.

#

you can use the avoidance system for moving objects

fallow hill
gusty spear
fallow hill
#

thanks

#

since I plan to have this be a turn based game do you think it is wise to re-generate the mesh every time an action is taken or would that be too computationally expensive

gusty spear
#

why do you need to change the mesh in the first place

fallow hill
#

well if lets say a physics object gets displaced by some sort of ability

#

or is that just better use the avoidance system u mentioned

gusty spear
#

while it is moving it is a task for the avoidance, when it is landed and static it can be baked to the navigation mesh.

#

small scenes with not a lot of baked geometry can be rebaked at runtime no problem but you need to test with the geometry that you want to consider in the baking process.