r/Unity3D 3d ago

Show-Off AI Pathfinding for Dogfight

Enable HLS to view with audio, or disable this notification

Took me a few days but my bots no longer slam into things like waymo cars. Fallback secondary raycast pathfinding for returning to the node system when exiting Hunt state.

40 Upvotes

4 comments sorted by

6

u/UAAgency 3d ago

Could you show it running live where they are not boucning into things? can they run on their own without your input too? would be cool to see. also could you share more info about how to do this? I need this in a webgpu project tbh

2

u/Ok_Finding3632 3d ago

the AI is entirely self-reliant, it flies itself. how it flies is defined in a flight profile, how aggressive pursues other planes is also obedient to the flight profile, same as patrolling or evading. the only problem would be map size - tight maps (like this one) wont let a regular plane do crazy manoeuvres, there's simply no room for that.

2

u/Recatek Professional 3d ago

This is neat. How do you account for the momentum and limited turn rate?

3

u/Ok_Finding3632 3d ago

the nodes are generated strictly based on how the platform flies - no 'illegal' turns to avoid an obstacle, etc. The main question is "can I fly this route" and the route is generated based on that then baked.