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