AStarPathfindingProject

A* Pathfinding compatibility issues with Unity 3.2: no problemo

If you’re using A* Pathfinding project and just updated your Unity editor to the 3.2 version, you will notice 3 errors in your console that were not there before:

Assets/Editor/AstarPathEditor.cs(372,59): error CS0122: `UnityEditor.EditorStyles.notificationBackground’ is inaccessible due to its protection level

Assets/Editor/AstarPathEditor.cs(372,35): error CS1502: The best overloaded method match for `UnityEngine.GUILayout.Button(UnityEngine.GUIContent, params UnityEngine.GUILayoutOption[])’ has some invalid arguments

Assets/Editor/AstarPathEditor.cs(372,35): error CS1503: Argument `#2′ cannot convert `object’ expression to type `UnityEngine.GUILayoutOption[]’

Well, don’t panic, here is a quick fix that will save your day you some minutes^^:

In the Assets/Editor/AstarPathEditor.cs file, line 372, replace

GUILayout.Button (co,EditorStyles.notificationBackground);

by

GUILayout.Button (co);

Save the file and go back to Unity editor: simple, right? you’re welcome XD

New version of the iTween+AStar test project

Here is a sexier version of the test project mixing iTween and AStar tools (see first post about it).

iTween configuration has been tweaked to fit a more realistic trajectory (player’s orientation is better than previous version but still not totally satisfying).

Below the interesting part of the main script (Player.cs):

iTween.MoveTo(gameObject, iTween.Hash

(

“path”, path,

“orienttopath”, true,

“looktime”, 1.0,

“lookahead”, 0.05,

“axis”, “y”,

“easetype”, iTween.EaseType.linear,

“time”, iTween.PathLength(path) / moveSpeed,

“oncomplete”, “OnMoveComplete”

));

See iTween.MoveTo method’s documentation for more details about parameters.

It also uses the soldier model from the Unity3D “Bootcamp” demo and its animations, that’s why the web player build and project archive are a bit heavier than before ^^;

Try the Web Player version (4.4 Mo) and/or download the project sources (24.6 Mo).

iTween + A* Pathfinding = <3

When pixelplacement’s iTween meets Aron Granberg’s A* Pathfinding, you get a quick demo of what you can achieve with powerful and easy to use tools.

With just 2 little scripts (basically 2 function calls, one for each tool), I easily managed to set a typical path finding system.

Try the Web Player version (86 Ko).

And here is the project sources (1.5 Mo).

Check comments in the Player.cs and KeyPoint.cs scripts for more details about this implementation.

Big up to Bob “pixelplacement” Berkebile and Aron Granberg for their work! o//

Edit : opened a thread on Unity3D “showcase” forum:

http://forum.unity3d.com/threads/70996-iTween-A*-Pathfinding-lt-3

 Scroll to top