- Home /
Waypoint Error.
Hello Everybody,
I have a little problem...
I have a code as ;
function PickNextWayPoint( currentWaypoint : AIWaypoints ) { var forward = transform.TransformDirection( Vector3.forward ); var best = currentWaypoint; var bestDot = -10.0;
for( var cur : AIWaypoints in currentWaypoint.connected )
{
var direction = Vector3.Normalize( cur.transform.position - transform.position );
var dot = Vector3.Dot( direction, forward );
if( dot > bestDot && cur != currentWaypoint ) //Prevents the NPC from looking at the current waypoint it is at; stops the NPC from looping back to the waypoint it is at;
{
bestDot = dot;
best = cur;
}
}
return best;
}
When i connect this script to my Character and when i play i take this error
"Assets/AI.js(249,46): BCE0018: The name 'AIWaypoints' does not denote a valid type. "
How can I solve this problem?
Regards
Vincenzo
Answer by qJake · Aug 02, 2010 at 04:45 AM
You don't have a script called "AIWaypoints". Wherever you copied and pasted this from, you need to also get the "AIWaypoints" script.
Your answer
Follow this Question
Related Questions
Using box collider to determine if AI should stop help 1 Answer
Help with a simple AI 2 Answers
Clearing a destination... 1 Answer
How to move to random position? 1 Answer