- Home /
              This post has been wikified, any user with enough reputation can edit it. 
            
 
             
               Question by 
               irene242 · Sep 24, 2014 at 01:11 PM · 
                2dgui2d-platformerpathfindinggui-button  
              
 
              GUI Button to replace a click on a waypoint in 2D pathfinding
I am creating a 2D pathfinding system for indoor navigation, and I am trying to create a GUI button that not only goes to the scene of the floor with the waypoints, but it also replaces what would have been a click on a specific waypoint, e.g. waypoint18, to enable an object navigate to that location.
This is the code i have at the moment;
using UnityEngine; using System.Collections;
public class Try : MonoBehaviour {
 public Waypoint exitPoint;
 public AI_Pathfinder ap;
 
 void Start () {
           }
 
 void Update () {
            }
 private void OnGUI()
 {
     if(GUI.Button(new Rect(15,15,100,50), "Waypoint18"))
     {
    Application.LoadLevel("GroundFloor");
        ap.nextWP = exitPoint;
     }  
  }
}
What should i add? Any help is appreciated. Thanks.
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                