hi everyone
here is the simple condition:
I have a sphere and I create a box collider from empty object
if the sphere hit the box collider, the game is over (show GUI pop-up / something)
Q1: I need the Java script
Q2: if any similar question as mine, link please
thankyou
Patico
April 8, 2014, 11:47am
2
Do you mean something like this?
void OnTriggerEnter(Collider collider)
{
if(collider.gameObject.tag == "myBeautifulSphere")
Application.Quit();
}
code for sphere or global setting?
The if-clause is just checking if the tag of Object what collided with the Player equals the string “myBeautifulSphere”.
Of course you can use another tag/string. Don’t forget to assign the tag to the GameObject.
That code would go on an object that is the final objective. You enter that sphere and then the game quits. (substitude myBeautifulSphere with Player)