Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Sneakiestspark · Feb 22, 2014 at 04:15 AM · c#javascriptnpc

How to make 3D text appear after conversation is complete?

I have an office game where I need to talk to an NPC and then after clicking the right text buttons, a 3D text in front of the elevators appears that you can click on to go the next level. This is a repurposed main menu script I found in a tutorial and it will load the next level when you click it:

 var LevelToLoad : String;
     var soundhover : AudioClip;
     var beep : AudioClip;
     var QuitButton : boolean = false;
     function OnMouseEnter(){
     audio.PlayClick(soundhover);
     }
     function OnMouseUp(){
     audio.PlayBeep(beep)
     yield new WaitForSeconds(0.35);
     if(QuitButton){
     Application.Quit();
     }
     else{
     Application.LoadLevel(LevelToLoad);
     }
     }
     @script RequireComponent(AudioSource)

Here is a conversation script I managed to find in a halfway done tutorial that was never completed and it is the closest thing I have for talking to an NPC:

 using UnityEngine;
 using System.Collections;
 
 public class myDialog : MonoBehaviour {
     
     string[] NPCTalk = new string[5];
     string[] PCTalk = new string[5];
     int myIndex = 0;
     bool myTalking = true;
 
     void Start(){
 
         NPCTalk[0] = "What's your name?";
         NPCTalk[1] = "Nice to meet you.";
         NPCTalk[2] = "How are you?";
         NPCTalk[3] = "I'm fine.";
         NPCTalk[4] = "Goodbye.";
 
         PCTalk[0] = "My name is Bob.";
         PCTalk[1] = "Nice to meet you too.";
         PCTalk[2] = "I'm doing well.  How are you?";
         PCTalk[3] = "I need to get going.";
         PCTalk[4] = "Goodbye";
                 }
 
         void OnGUI () {
             if(myTalking){
                 GUI.Label(new Rect (575, 200, 150, 150), NPCTalk[myIndex]);
                 if (GUI.Button(new Rect(575, 250, 150, 30), PCTalk[myIndex]))
                     if(myIndex >= 4)
                         myIndex = 4;
                 else
                     myIndex++;
                 if (GUI.Button(new Rect(575, 300, 150, 30), "Say again."))
                     myIndex = 0;
                 if (GUI.Button(new Rect(575, 350, 150, 30), "Bye!"))
                     myTalking = false;
         }
     }
 }

I just need to figure out how the 3D text will appear after the conversation has ended. I do realize that the first script is in Javascript and the second is in C#. If anyone can point me in the right direction or link me to a tutorial that shows how to do that it would be greatly appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

Best place to learn Marching Cubes Algorithm? 2 Answers

Which language should I start learning for scripting? 1 Answer

Calling c# function from a JS 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges