Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: stvbabb on April 22, 2018, 07:28:34 AM
-
Hello,
I'm trying to compare a string coming from a TextMesh Pro Input Field game object and then compare that string with a password using the 'Compare String' action.
The Equal Event is Pass
The Not Equal Event is Fail.
There is a button that sends an event with an on click event to Get the Text of the TextMesh Pro string and then move on to the compare while carrying the TextMesh Pro text over in a variable.
TLDR;
Can I not compare TextmeshPro strings using the 'Compare String' Action?
Thanks,
Steve
-
Hi, I have full set of textmesh pro actions here. It includes get/set string for textmesh ugui and textmesh 3d text. Once you have gotten the string from textmesh pro, then you can do a compare.
https://github.com/dumbgamedev/TextMeshPro_Playmaker
-
Hey tcmeric,
Thanks for the response! Sorry, my first post was unclear. My brain was in full 'fix this issue' mode and not in plain English mode.
But, I'm actually using your wonderful actions for TextMesh Pro already (thank you for that!), and I'm able to get strings from TextMesh Pro already and convert string to int and stuff like that, but that compare string action coming from a TextMesh Pro string just doesn't seem to work. It gives me untrue every time. I'll try again.
Also, will your TextMesh Pro actions be on the ecosystem at some point?
Thanks,
Steve
-
Hi, no, I have other plans for it. But a copy will always remain for free on github.
Once you use the text mesh pro text into a string, its just a normal playmaker string. Not related to TMP at all 8)
-
Hi tcmeric,
I think it has to do with getting the text from an TMP input field. I can't seem to get it work.
In the pictures attached you see I'm getting the text from the Get Textmesh Pro UGUI Text action and then moving on the string compare action in the compareText state. It just won't prove equal, it fails every time.
I'll just have to use the standard InputField and get the text using the U Gui Input Field Get Text action. If you have any other suggestions I'd love to try them. :)
Cheers,
Steve
-
Hmm, I see. Ill give it a go on my end later. I am sure we can figure it out :)
-
Okay, thanks! I tried writing my own Get TextMesh Pro Text from input field, but I didn't get too far. However, I think that is the bug - getting it from a TMP InputField game object.
Cheers and thanks,
Steve
-
Seems like I am having trouble attaching actions here on the forum today.
I added them to the github: https://github.com/dumbgamedev/TextMeshPro_Playmaker
Action name is setTextmeshProInputText & getTextmeshProInputText
Tested them and they seem to be working ok. Let me know how it goes.
-
Thanks!! That is really helpful! I'll test them tonight for sure and report back.
Cheers,
Steve