Question by
xXMachinaXx · Sep 15, 2016 at 12:43 PM ·
scripting problem
Help setting dialog box to true
Hello, can you help me to set active to true my dialogue box here i don't know what's the problem. thank you here's my code.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class DialogueHolder : MonoBehaviour
{
public GameObject dbox;
public Text txt;
// Use this for initialization
void Start()
{
dbox.SetActive(false);
}
// Update is called once per frame
void Update()
{
if (dbox && Input.GetKeyDown(KeyCode.Return))
{
dbox.gameObject.SetActive(false);
}
}
void onTriggerEnter2D(Collision2D coll)
{
if (!dbox)
{
if (coll.gameObject.tag == "Player")
{
dbox.gameObject.SetActive(true);
}
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Class structure for diferent item types and items that do different things. 0 Answers
Please Help Me: Assets/Scripts/PlayerControaller.cs(34,33): error CS8025: Parsing error 1 Answer
Rigidbody changes reference in play time to the game object that the script is attached to 1 Answer