What would the code be if I wanted the collision of one gameObject into another gameObject to be the game end?
Are you looking to return to something like a start-up GUI?
yes, or i just want a GUI text to pop up after the one object has collided with the other
Well you have one of 2 ways you can either set an if statement in OnGUI, and once you collide with that object have that statement equal true, then it displays the GUI. Also you can make a Prefab of an empty GameObject and have it Instantiate when you hit the object that triggers it. (which is my favorite thing to do)
this is the script that I have on the platform (which is the object the spaceship collides with) as of right now, if I put this script onto the empty prefab where would I incorporate the instantiate function? and how would it be scripted?
function OnGUI (other : Collider) {
if (Collider) {
//make background box
GUI.Box(Rect (10,10,100,100),“You Win!”);
}
}
use the example in there, make a boolean parameter called collider
then on your
OnGUI() function,
if(collider)
{
// show gui
// application quit
}