Variable and TextInput issue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KakimaAkuma
Posts: 29
Joined: Mon Sep 09, 2019 9:51 pm

Variable and TextInput issue

Post by KakimaAkuma »

I have this weird bug where I'm changing one variable using User Input and it affects another variable instead.

Block1
TextInput(Text Field UI, Test-1, Test1);
*Inputs "Kakima"

Block2
Dialogue: Your input is [lua(Actor["MainPlayer"].Test1)]
Script: Actor["MainPlayer"].Test1= Variable["Test1"]

Expected Output: Your input is Kakima
Current Output: Your input is

Block3
TextInput(Text Field UI, Test-2, Test2);
~Kakima appears in input field instead of Test-2
*Inputs AAAAA

Block4
Dialogue: Your input is [lua(Actor["MainPlayer"].Test2)]
Script: Actor["MainPlayer"].Test1= Variable["Test1"]

Expected Output: Your input is AAAAA
Current Output: Your input is
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable and TextInput issue

Post by Tony Li »

Your setup looks correct to me. Here's an example (exported from Unity 2018.1) that works. Would you please compare it to your example? Maybe you'll see a difference that is causing the issue.

TextInputExample_2019-09-23.unitypackage

If that doesn't help, please feel free to send a reproduction example to tony (at) pixelcrushers.com. I'll be happy to take a look.
KakimaAkuma
Posts: 29
Joined: Mon Sep 09, 2019 9:51 pm

Re: Variable and TextInput issue

Post by KakimaAkuma »

Sent test package
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable and TextInput issue

Post by Tony Li »

Thanks for sending the package. The Input Field was unassigned. If you assign InputField (TMP), it should work correctly:
textFieldUITMP.png
textFieldUITMP.png (87.95 KiB) Viewed 634 times
KakimaAkuma
Posts: 29
Joined: Mon Sep 09, 2019 9:51 pm

Re: Variable and TextInput issue

Post by KakimaAkuma »

Turns out the Text Pro UI Input field went missing. I just replaced it with a non text mesh pro one.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Variable and TextInput issue

Post by Tony Li »

Hmm, if you want to go back to TMPro, make sure your Scripting Define Symbols includes TMP_PRESENT. One way to add this is to select menu item Tools > Pixel Crushers > Dialogue System > Welcome Window and click the TextMesh Pro Support checkbox. Then if you unassign the Unity UI version of the Input Field, it should show unassigned versions for Unity UI and TMPro.
Post Reply