So i’m trying to make random gui’s appear when the player enters a trigger. I’m not sure if random gui’s are the right things to use for this. If anyones played Mount and Blade i’m trying to make it like that were theres a description of some stuff thats happening overlayed on a picture, and then several options that you can choose from to respond to what is happening.
I know this script doesn’t work I just made it to be a rough idea of what i’m trying to do.
`using UnityEngine;
using System.Collections;
public class DetectGridGrassland : MonoBehaviour {
void OnTriggerEnter(Collider other)
{
Debug.Log("Player entered the Grass Land");
float rnd = Random.value;
if ( rnd < 0.05 )
{
GUI.Box (Rect (10,10,100,90), "Attacked by bandits");
}
else if ( rnd < 0.15 )
{
GUI.Box (Rect (10,10,100,90), "Attacked by wolves");
}
else
{
GUI.Box (Rect (10,10,100,90), "Nothing happens");
}
}
}
}`
Here is what i’m trying to achieve.