Hi,
I'm making text adventure game.
What I'm going to do is,
If I click the button(Unity.UI button),
the Gameobject that contains Conversation Trigger component(On Enable Setting) will appear.
and Dialogue event will activate.
when I click the button
Gameobject appears well....
but the problem is...
Conversation Trigger component disappears itself!
Well.. I can't understand why the component destroys itself.
Is there any special setting for Unity UI Button?
p.s Thanks for your time.
-----------------------------------------------------------------------------------
To add
I just write the script for the button like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SetActiveUI : MonoBehaviour
{
public GameObject GO;
public void OnClick()
{
{
GO.SetActive(true);
}
}
}
and setting for the button.
little problem with Button UI
little problem with Button UI
- Attachments
-
- 2.png (24.42 KiB) Viewed 649 times
Last edited by Frioniel on Sat Nov 04, 2017 11:18 am, edited 1 time in total.
Re: little problem with Button UI
Hi,
Did you tick the "Once" checkbox? This destroys the Conversation Trigger after it's used once.
Did you tick the "Once" checkbox? This destroys the Conversation Trigger after it's used once.
Re: little problem with Button UI
Oh... I think I forgot to turn off the Once function.
But..
still there's the problem
Dialogue event doesn't work even if Conversation trigger exists.
But..
still there's the problem
Dialogue event doesn't work even if Conversation trigger exists.
Re: little problem with Button UI
Is the Conversation Trigger's Trigger dropdown set to OnEnable?
If you inspect it at runtime after clicking the UI button, does the Condition section say True or False?
If you inspect it at runtime after clicking the UI button, does the Condition section say True or False?
Re: little problem with Button UI
Yep! I checked several times that dropdown set to the OnEnable.
and I don't get it what's the last sentence means.
Does it mean, while playing the game, does console window show the error?
if it is right, well... there's no error in console window (Currently debug level in dialogue manager is info setting)
and I didn't handle anything in condition section. (It means, condition section is empty)
and I don't get it what's the last sentence means.
Does it mean, while playing the game, does console window show the error?
if it is right, well... there's no error in console window (Currently debug level in dialogue manager is info setting)
and I didn't handle anything in condition section. (It means, condition section is empty)
Re: little problem with Button UI
Here's an example scene:
ButtonGameObjectConversationExample_2017-11-05.unitypackage
This is how I set it up:
1. Created an empty GameObject named "Conversation GameObject" with a Conversation Trigger set to OnEnable, and deactivated the GameObject:
2. Created a UI button. Instead of using a script, I configured the OnClick() event to activate "Conversation GameObject" and make the UI button non-interactive:
3. When "Conversation GameObject" becomes active, the Conversation Trigger checks if it should run. Since the Condition is empty, it's always true:
ButtonGameObjectConversationExample_2017-11-05.unitypackage
This is how I set it up:
1. Created an empty GameObject named "Conversation GameObject" with a Conversation Trigger set to OnEnable, and deactivated the GameObject:
2. Created a UI button. Instead of using a script, I configured the OnClick() event to activate "Conversation GameObject" and make the UI button non-interactive:
3. When "Conversation GameObject" becomes active, the Conversation Trigger checks if it should run. Since the Condition is empty, it's always true:
Re: little problem with Button UI
Hello
I tried as your guide
If I click the button, then the GameObject is active well
But...
stilll the conversation event doesn't work
is there another setting for conversation event?
-----------------------------------------
Try to do
1. Button Click -> GameObject becomes active -> then Conversation Event (Database) works.
Current
1. Button Click (Clear ) -> Gameobject becomes active (Clear ) -> then Conversation Event works. (Not Clear )
I tried as your guide
If I click the button, then the GameObject is active well
But...
stilll the conversation event doesn't work
is there another setting for conversation event?
-----------------------------------------
Try to do
1. Button Click -> GameObject becomes active -> then Conversation Event (Database) works.
Current
1. Button Click (Clear ) -> Gameobject becomes active (Clear ) -> then Conversation Event works. (Not Clear )
Re: little problem with Button UI
When you do this, inspect the Conversation Trigger. Does its condition say (Last Check: True) or (Last Check: False)?
If you set the Dialogue Manager's Debug Level to Info, does the Console window show anything when you click the button? Look for a line such as:
Does the example scene (in my previous reply) work for you?
Please feel free to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.
If you set the Dialogue Manager's Debug Level to Info, does the Console window show anything when you click the button? Look for a line such as:
Code: Select all
Dialogue System: Starting conversation 'title'...
Please feel free to send an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.