- Home /
%Mission script%
How can I make an object a "Goal" but also make the mission visible on-screen?
How has voted this question down? it is a really awsome question.
@DanishDude: I'd guess the question was voted down because it's not very clear or specific.
Answer by Justin Warner · Dec 31, 2010 at 03:46 PM
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.
Answer by Boeing® · Jun 10, 2013 at 11:06 AM
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
}
}
Your answer
Follow this Question
Related Questions
One Action/Mission at a time 1 Answer
How do I make a mission objective? 1 Answer
Check slected mission status in inspector 1 Answer
Array of scripts 2 Answers
mission help 1 Answer