How can I make an object a "Goal" but also make the mission visible on-screen?
Well, that'd be GUI, make a label, position it where ever, make a string that appears there, and then you can change the string through code as the player travels... You could even add a num_Missions and make it bullet pointed.
var stringHere = "Hey! This is your mission stuff";
function OnGUI () {
GUI.Label (Rect (10, 10, 100, 20), stringHere);
}
function Update () {
//Psuedo: If player did this (Boolean);
stringHere = "This is your new mission";
}
This is probably sloppy/not working, but you get the idea.
Here You Are The Sripts
1). Attach this script to the player, Named mission
static var theObject : int = 0;
function Update ()
{
if(theObject == 3)//the notice for objective
{
Debug.Log("theObject is 3, Mission Sucess");//Costumesize what
//ever youlike
}
}
2). Attach this to theObject you create
static var amout : int = 1;//this is what amout of your object
function OnTriggerEnter (player : Collider)
{
if(player.gameObject.tag == "Player")//the tag of player
{
mission.theObject += amout;
Destroy(this.gameObject);//Destroy the Object
}
}