Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 syedamadiha82 · Sep 13, 2018 at 07:31 AM · errordialogueinput.getbutton

not taking input

im trying to make a dialogue system for my game and i followed an online tutorial and did some changes in it but it only shows talk on screen but its not taking input instead shows 'input not found' in the log. the original coding was working fine for me but the code in not working anymore after my changes. can anyone tell me what am i doing wrong? im stuck at this

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;

public class DialogueScript : MonoBehaviour {

 public GameObject ActionCanvas;
 public GameObject ActionChar;//shows [e] on screen 
 public GameObject ActionText;//shows talk on screen
 public GameObject DialogueCanvas;
 public GameObject TextBox;//panel
 public GameObject DialogueName;//name textbox 
 public GameObject DialogueText;//text textbox 

 void OnTriggerEnter(Collider col)
 {
     ActionText.GetComponent<Text> ().text = "Talk";
     ActionCanvas.SetActive (true);

     if (Input.GetButtonDown ("Action")) {
         ActionCanvas.SetActive (false);
         StartCoroutine (NPC001Active ());
     } 
     else 
     {
         Debug.Log("input not found", gameObject);
     }

 }

 IEnumerator NPC001Active () {
     DialogueCanvas.SetActive (true);
     TextBox.SetActive (true);
     DialogueName.GetComponent<Text> ().text = "Warrior";
     DialogueText.GetComponent<Text>().text = "Hello friend, I may have a quest for you if you wish to accept it. Please come back later on this afternoon.";
     yield return new WaitForSeconds(5.5f);

     DialogueCanvas.SetActive (false);
     ActionCanvas.SetActive (true);
 }

}

Comment
Add comment · Show 1
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
avatar image syedamadiha82 · Sep 13, 2018 at 07:33 AM 0
Share

https://jvunity.weebly.com/uploads/4/7/6/0/47606749/rpg_016_scripts.txt this is the original code and uses raycasting but im working on trigger

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Sonky108 · Sep 13, 2018 at 08:10 AM

It has nearly no chances (if any) to work. The game need to meet two requirements to show dialogue. First OnTriggerEnterneed to occure which is called once and at the same time Action button need to be pressed not held down. As you can see the situation is nearly impossible.

Comment
Add comment · Show 7 · Share
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
avatar image syedamadiha82 · Sep 13, 2018 at 10:14 AM 0
Share

oh now i understand, thanks. Can you suggest me any other way similar to it?

avatar image Sonky108 syedamadiha82 · Sep 13, 2018 at 10:50 AM 0
Share

I can, but I need to know how you want it to behave. For now it seems that you've tried you make something like: 1. Go near the character; 2. Press the button to talk.

Right?

avatar image syedamadiha82 Sonky108 · Sep 15, 2018 at 07:37 AM 0
Share

yes, i want the the player to go near a character, (there will be option if the player wants to interact or not but ive kept it for afterwards), then press button and dialogues appear, then the player accepts or declines a task at the end of the conversation. im basically trying to make a decision driven game but as im kinda new to unity so im encountering problems related to coding in it.

Show more comments

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

121 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 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 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 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 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 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 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

Dialogue Code 0 Answers

Operator '*' cannot be used with a left hand side ....... 1 Answer

cant install unity 1 Answer

Character keeps moving in one direction on its own 4 Answers

Upgraded to Unity 3.4.2, Xcode Errors 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