Pathfinding around obstacles.

Hey yalls I’m working on a cover based shooter system where the AI attempts to go behind cover. The problem I’m having is the AI will want to be on the opposite side of the enemy but will attempt to walk through the cover to do so but can’t. is there a way with the steering actuator to let units know to walk around obstacles? or do i need to reset the NAVmesh with data in relation to the cover spots?

I hope that made sense

In world settings , in bottom, obstacle simulation

I make holes in a plane by deleting vertices and then convert it into a navmesh.

I’m currently trying 3d solar system builder’s idea but I’mma hit up BluePrintRandom’s idea. Thanks!

Unfortunately i can’t use the create obstacle method cause it isn’t supported with the character physics type.

:smiley:

in “ghosts”
(ghost static marked obsticals
static ghost invisible
always----------move to here


import bge
if 'targetObject' not in own:
    own ['targetObject']=bge.logic.getCurrentScene.objects[own['target']]
else:
    T=own['targetObject']
    own.worldPosition=T.worldPosition

in unit

delay(once)--------------add unit


import bge
added=bge.logic.getCurrentScene.addObject('StaticGhost',own,0)
added['target']=own

when added, a unit creates a item that moves along with it, marked as a obstacle ?

(untesteD)

ok, characters can’t use navmeshes,

check this out

GuideBot

Attachments

GuideBot.blend (473 KB)

Ok very interesting solution. Not sure if I saw this right but it looks like you were using a “guidbot” to move for the character and just have the character follow the guide bot. am I right?

yeap :smiley:

you can use other method then tract to though (track to will rotate things inside others)

I would have a object (no collision) in the unit track to a programmable target

then I would use some equation (I have one :D) to apply torque to align to the track to

(this way your units wont get tracked to into walls)

so

select unit

set target

guidebot is moved to unit

unit “tracker” tracks to (2d)

unit applies torque to match

lol I guess characters can’t use physics

here

not perfect (uses scene.objects every frame)

but demonstrates using less logic than near sensor or ray etc

but will move through items not marked as a obstacle …

Attachments

GuideBot2.blend (477 KB)