Hey all,
I was recently using the pathfinding actions to set up character movement which works great!
I next thought it would be cool to use the line renderer to draw a line along my navmesh path. To do this, all I need is to feed the corners of the FSMNavMeshPath to the line renderer. However, the "corners" section doesnt seem to populate, even when a valid path is stored.
Upon further searching within the FSMNavMeshPath script, I see that it was left unfinished:
TODO: implement FsmNavMeshPath properly in NavMeshCalculatePath and NaMeshCalculatePathBetweenGameObject.
// this is currently very much under progress, not sure if this is the right way to go about this. maybe too advanced and should be left to user to implement this?
I think this information could be used for a lot of interesting things.
Would it be possible for someone to round this script off to include the ability to store (and access) the corners info for a path? Is this an inordinate amount of work? I'm no programmer so tell me if this is a lot.
// (c) Copyright HutongGames, LLC 2010-2014. All rights reserved.
//
// TODO: implement FsmNavMeshPath properly in NavMeshCalculatePath and NaMeshCalculatePathBetweenGameObject.
// this is currently very much under progress, not sure if this is the right way to go about this. maybe too advanced and should be left to user to implement this?
using UnityEngine;
using System.Collections;
public class FsmNavMeshPath : MonoBehaviour {
//Corner points of path
public Vector3[] corners;
/*
{
get {
if (path== null)
{
return null;
}
return path.corners;
}
}
*/
public NavMeshPathStatus status
{
get
{
if (path== null)
{
return NavMeshPathStatus.PathInvalid;
}
return path.status;
}
}
public NavMeshPath path;
// Use this for initialization
void Start () {
}
void ClearCorners()
{
path.ClearCorners();
}
public string GetStatusString()
{
if (path ==null){
return "n/a";
}else{
return path.status.ToString();
}
}
}