Hello to all members of the forum.
I am a newbie in unity .
i have a script called boxTrigger and i want when a user collides with an object(cube) to show message…
How can i do it . With onGui? Please help…
using UnityEngine;
using System.Collections;
public class boxTrigger : MonoBehaviour
{
public Light light;
public Light light2;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
void OnTriggerEnter(Collider collider)
{
light.enabled=true;
light2.enabled=true;
}
void OnTriggerExit(Collider collider)
{
light.enabled=false;
light2.enabled=false;
}
}
// var mySkin : GUISkin;
// Assign the skin to be the one currently used.
//GUI.skin = mySkin;
// Make a button. This will get the default “button” style from the skin assigned to mySkin.
// GUI.Button (Rect (10,10,150,20), “Skinned Button”);
327533–11554–$boxtrigger_856.cs (701 Bytes)