Hey …I am a beginner. I am following tutorial ‘get started …’ , but I stuck at title ‘Moving Stuff Around’, i can’t get the green line connect start to end pos just like the image attached the tutorial.
My green line just like a lint on my capsule…and i log out the info of ‘startnode’ and ‘endnode’ of parameter ‘path’ passed by ‘OnPathComplete(Path path)’ function. startnode[x:50,z:50] endnode[x:50,z:49](the end node should be [80,20] here)…
notes the cute green lint i marked up by red circle in the screen-capture…It makes me crush…
and my code followed…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pathfinding;
public class AstarAI : MonoBehaviour {
public GameObject Target;
public void Start () {
//Get a reference to the Seeker component we added earlier
Seeker seeker = GetComponent<Seeker>();
//Start a new path to the targetPosition, return the result to the OnPathComplete function
seeker.StartPath (transform.position, Target.transform.position, OnPathComplete);
}
public void OnPathComplete (Path p) {
Debug.Log ("Yay, we got a path back. Did it have an error? "+p.error);
}
}
What is the problem ? Thanks!!