All answers are forming all over each other in response button

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Evgeny
Posts: 16
Joined: Sun Mar 13, 2016 11:18 am

All answers are forming all over each other in response button

Post by Evgeny »

All answers buttons are formed in one place at once. Then in a second they are moved to their places.
Buttons size for answers does change depending on amount of lines for each answer.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: All answers are forming all over each other in response button

Post by Tony Li »

Hi,

What GUI system are you using? I'm guessing Unity UI (as in Unity UI Dialogue UI). If so, are you using a prefab dialogue UI or one you've made? If you're using a prefab, which one?

It sounds like the Unity UI auto-layout components (e.g., Content Size Fitter, Vertical Layout Group, etc.) are taking effect after the first frame that the UI elements are visible. If this is the case, here are two ways to address it:

1. Add an Animator to the Response Menu > Panel with an animator controller that has Show and Hide animations, similar to the Animator that's probably on your Dialogue > Panel. For the Show animation, start the first frame with the panel invisible (e.g., Canvas Group alpha = 0). In the second frame, make the panel visible (Canvas Group alpha = 1). Reverse the process for the Hide animation. I can provide more details if you need it.

2. Or adjust the Script Execution Order of the Dialogue System's Unity UI components so they run before the Unity UI layout components. I don't know which ones to suggest at the moment because I don't know exactly what's going on, or if you're even using Unity UI.
Evgeny
Posts: 16
Joined: Sun Mar 13, 2016 11:18 am

Re: All answers are forming all over each other in response button

Post by Evgeny »

We use NGUI.
I will try the first offered option. The problem because in buttons of answers the quantity of lines changes and because of it goes rebuild of the table.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: All answers are forming all over each other in response button

Post by Tony Li »

Sounds like a good approach. The steps I listed previously were intended primarily for Unity UI, but you can do something similar with NGUI. If you need any assistance, just let me know!
Post Reply