Unity logo
Cancel
Cart
Applications
Sell Assets

Over 11,000 five-star assets

Rated by 85,000+ customers

Supported by 100,000+ forum members

Every asset moderated by Unity

Home
Tools
Behavior AI
1/2
Ultimate A* Pathfinding Solution contains the necessary algorithm to apply A* pathfinding to any situation, whether the scene is made of tiles, colliders, nodes. 2D or 3D!
Render pipeline compatibility
The Built-in Render Pipeline is Unity’s default render pipeline. It is a general-purpose render pipeline that has limited options for customization. The Universal Render Pipeline (URP) is a Scriptable Render Pipeline that is quick and easy to customize, and lets you create optimized graphics across a wide range of platforms. The High Definition Render Pipeline (HDRP) is a Scriptable Render Pipeline that lets you create cutting-edge, high-fidelity graphics on high-end platforms.
Unity VersionBuilt-inURPHDRP
2020.3.31f1
Compatible
Compatible
Compatible
Description

This A* pathfinding solution contains Pathfinder class designed to fit any situations as long as the class is supplied with a method that calculates a heuristic approximation of distance between two nodes/points or any other objects, and a method that returns connected nodes/points or objects of same type and their distances as floats.

Technical details

Usage:


Pathfinder<T>() mypathfinder= new Pathfinder<Vector3>(HeuristicDistance, ConnectedNodesAndStepCosts,calculatorPatience);


mypathfinder.GenerateAstarPath( A, B, out path);


T: Any class or struct that has a way to measure distance between its instances. Examples are; Vector3, Vector2, Vector3Int etc. It can even be a custom class as long as there is a measurable distance between its instances.

HeuristicDistance: any method name that takes two T instances and returns an aproximate distance

ConnectedNodesAndStepCosts: any method name that takes a T instance and returns a dictionary of its neighbours as the keys and distances to the neighbours as the values.

calculatorPatience: the number of steps that the algorithm calculate before giving up. It is a safety precaution for testing. I advise starting with 100 or less and increasing to 9999 or more after testing.

GenerateAstarPath: returns true if exists a path from starting instance to ending instance, and outputs a list of adjacently connected T instances that lead to the target (path).


Ultimate A* Pathfinding Solution

(11)
160 users have favourite this asset
(160)
FREE
160 views in the past week
Quality assets
Over 11,000 five-star assets
Trusted
Rated by 85,000+ customers
Community support
Supported by 100,000+ forum members
Unity logo
Language
Feedback
Partners Program
Partners
USD
EUR
Copyright © 2025 Unity Technologies
All prices are exclusive of tax
USD
EUR