Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

I want that object to open a dialog box. how do I do.

Discussion in '2D' started by orkys, Apr 12, 2016.

  1. orkys

    orkys

    Joined:
    Aug 9, 2015
    Posts:
    29
    Hello How do I make it, when someone presses to select an object, I want that object to open a dialog box. how do I do. @Malicok ou @Malicok
     
  2. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    What do you mean? Like when you collide with an object a dialog box pops up?
     
  3. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86


    Try this
     
  4. orkys

    orkys

    Joined:
    Aug 9, 2015
    Posts:
    29
    Yes, I want to click on an object, a message appears.
    But I'm making a game for Android mobile. Touch screen.

    Forgiveness does not understand much English, the video you sent not you help me a lot because I do not understand much English. I could only stare and copying, as it does to do this. But Thank you for wanting to help .... Sou Brasileira. Brasil Vai BrasiLLLLL. Fora Dilma Rousseft...
     
    Last edited: Apr 13, 2016
  5. orkys

    orkys

    Joined:
    Aug 9, 2015
    Posts:
    29
    Bem consegui fazer uma Parte. Mas, ficou um pouco complicado, e o vídeo muito longo. pode ser algo direto e reto, Bem para resumir deu erro ou colocar outro painel, Bem vou explicar melhor...
    exemplo: Um Objeto chamado- Sphere0, Sphere1, Sphere2 e Sphere3,
    na primeira Sphere0 fica tudo certo CameObject- Canvas- Panel- Text- EventSistem. ok
    Mas no Sphere1 ao fazer tudo acima desaparece mesmo eu colocando na posição da primeira Sphere0.
     
  6. orkys

    orkys

    Joined:
    Aug 9, 2015
    Posts:
    29
    I managed to put in all the Object, the problem was in Scale- had to leave, 1- 1- 1- of each scale. The rpoblema now is the script that I did not understand. did not work.
     
  7. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    Post your script or the part your having trouble in.
     
  8. orkys

    orkys

    Joined:
    Aug 9, 2015
    Posts:
    29
    Hello?
    Well, I did just as I was in that video. This script, which was in that video
    I must inform you that on each click, the person makes the objects, a message appears. It was very good the dialogues I did. now I need to make acada click the person makes the objects appear a message.
    I inform you that I am translating into google translator. and is not quite sure. It does not translate right I hope you understand.


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

    public class Sphere1 : MonoBehaviour

    public GameObject messageBox;
    public Text messageText;

    public string message;

    void Interact()
    {
    messageBox.SetActive (true);
    messageBoxText.Text = message;
    }

    void Update()
    {
    if (Input.GetButtonDown ("Firel"))
    {
    messageBox.SetActive (false);
    }
    }
    }