Sorry ahead of time for the many questions I might post, the scripting in Unity is completely different from what I have learned from XNA 3.0, it was the last time I was actually into coding and scripting for games but lost interest since the stuff never worked.
Currently in the game I am working on with 2 of my friends I have a small GUI.Lable message going for dialog given by the character that you play through a timer setup. And when the player gets to the object how do I trigger a event when the character that you play do a different set of text given over time? Like for example I have the main character say a few lines saying that they hope that the foul beast does not find them. Now When the player goes up to this object that seems very out of place I want the character to say something like this when they get close to it: I wonder what this object does? but ONLY when they get near the object.
For the next question, if I setup a script like this:
using UnityEngine;
using System.Collections;
public class TimedMessages : MonoBehaviour
{
public float TextDisplay = 0;
public float TextDisplay2 = 0;
public float TextDisplay3 = 0;
void OnGUI()
{
if(TextDisplay < 10)
{
GUI.Label(new Rect(((Screen.width / 2) - 90),((Screen.height /2) + 300),300,25),"I hope that Foul Beast is gone....");
}
if(TextDisplay2 < 20 && TextDisplay2 > 11)
{
GUI.Label(new Rect(((Screen.width / 2) - 100),((Screen.height /2) + 300),300,25),"If not I do not know what to do to escape it....");
}
if(TextDisplay3 < 30 && TextDisplay3 > 21)
{
GUI.Label(new Rect(((Screen.width / 2) - 90),((Screen.height /2) + 300),300,25),"Lets hope for the best...");
}
}
// Update is called once per frame
void Update()
{
TextDisplay += Time.deltaTime;
TextDisplay2 += Time.deltaTime;
TextDisplay3 += Time.deltaTime;
}
}
What would I do to start a Audiofile right when the text shows up?
(Not sure if the code goes into a code box I click the button but it doesnt show up in the Preview D:)
Now for the last question, What would I do to change the default controls for the game and the name for the control settings? Apparently going to Edit => Project Settings => Input does not do what I thought it was for and when I rename the input to something else it just bugs it out and makes it unusable.
Again I am very sorry for the long question still trying to get familiarized back into game development and learning how Unity works.