This is my script: using UnityEngine; using System.Collections; public class IntroDialogueText : MonoBehaviour { //Declar variables. string[] NPCTalk = new string[11]; string[] PCTalk = new string[11]; int myIndex = 0; bool myTalking = false; public GameObject CameraPositionPrefab; public GUISkin skin; void Start() { //Initialize values. NPCTalk [0] = "General : We're going to have to use that new Sargent for this job."; NPCTalk[1] = "Captain : Sir, with all due respect...what the hell are you thinking?"; NPCTalk[2] = "General : I'm Sorry? Are you questioning my decision Captain?"; NPCTalk[3] = "Captain : Yes sir I am! How can you possible send a fresh Sargent on a Commander's job? "; NPCTalk[4] = "General : Because he's my soldier."; NPCTalk[5] = "Captain : So what?!"; NPCTalk[3] = "General : He's just a gutterspine anyway."; NPCTalk[4] = "Captain : Sir? How can you say that?"; NPCTalk[5] = "General : Come now...like we don't all think that!"; NPCTalk[6] = "Captain : I see the Emperor's bigotry has gotten to you. Beyond the point sir, why would you send the Sargent to do a Captains Job. Send me even!"; NPCTalk [7] = "General : Look Captain...it's either the Sargent's head...or mine."; NPCTalk[8] = "Captain : ...He's part of YOUR navy Sir. You can't just do this to him."; NPCTalk [9] = "General : I can...and I will."; NPCTalk[10] = "Captain : ...Understood Sir."; PCTalk[0] = @"Next"; PCTalk[1] = @"Next"; PCTalk[2] = @"Next"; PCTalk[3] = @"Next"; PCTalk[4] = @"Next"; PCTalk[5] = @"Next"; PCTalk[6] = @"Next"; PCTalk [7] = @"Next"; PCTalk[8] = @"Next"; PCTalk [9] = @"Next"; PCTalk[10] = @"Next"; } void OnGUI () { GUI.skin = skin; //Display the Dialog. if (myTalking) { GUI.Label (new Rect (475, 700, 800, 75), NPCTalk [myIndex]); if (GUI.Button (new Rect (685, 800, 350, 30), PCTalk [myIndex])) if (myIndex >= 10) myIndex = 10; else myIndex++; if (GUI.Button (new Rect (20, 350, 100, 30), "Skip")) { myTalking = false; { animation.Play ("MoveToShip"); } } } } void OnTriggerEnter (Collider other) { myTalking = true; Debug.Log ("Object has entered"); } void OnTriggerExit () { myTalking = false; } } For some reason when I have on trigger enter it wont start the dialogue menu. Can anyone help?
Oh that's probably it I didn't have a rigidbody on it. Should I add it to the object going into it or the trigger collider.
Rigidbody or characterController should both trigger a "trigger" collider. Also make sure that the isTrigger checkbox for the collider is set in the inspector to true. Hope this helps!
Oh sry didn't see your post at first. Do you know why it's only displaying in the log and not showing the rect?
I think I solved it, your rects are defining X Y coordinates way off the screen, when I set these to 0 they were in view!
I have a new issue When I click next (aka pc talk) it still shows the new line but the first line stays for some reason. Edit : Fixed