Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking inputfield in Unity does not open keyboard (and enable the inputfield?) #34

Closed
rafbanaan opened this issue Aug 21, 2019 · 9 comments

Comments

@rafbanaan
Copy link

rafbanaan commented Aug 21, 2019

With my Unity game I have a scene where a user can fill in an username and email address. These two last items are inputfields, but I'm having issues with this.

When I click on the inputfields nothing happens. I don't see a cursor in the inputfield and the keyboard doesn't pop up.

When I build it native for android it works.

Any tips or is this a bug? I can't find a solution in Unity especially when the native android build works perfect. I do have a 6 buttons in this scene and those work.. in the sense that I can click them and they activate.

@juicycleff
Copy link
Owner

@rafbanaan I believe this will not work for now and it's not an issue from unity, I am suggesting you use events to show the keyboard and see if input works ok

@rafbanaan
Copy link
Author

Ok, I will give it a try with the events.

@thomas-stockx
Copy link
Collaborator

Most Unity games will actually use a native TextField (iOS or Android) since there's better support for copy/paste/etc, and send the result back to Unity.

You can do something similar by allowing Unity to trigger a Flutter TextField (with keyboard), and send the resulting input back to Unity to continue your game. That way you don't need to handle any text input in Unity, but handle it all in Flutter!

@rafbanaan
Copy link
Author

rafbanaan commented Aug 22, 2019

So, if I read it correctly it's more common that in my case I convert my start scene with the inputfields and button into a flutter page which sends the results back to Unity?

Since I don't see that you can do flutter input textfields on a full screen Unity game?

I'm a bit new to the whole flutter / Unity integration :p

@thomas-stockx
Copy link
Collaborator

@rafbanaan exactly! You can build your login/registration screen in Flutter, and after authentication you can navigate to a new Flutter page with Unity embedded, and send any authentication details through to Unity so it does not need to render any UI.

@rafbanaan
Copy link
Author

rafbanaan commented Aug 24, 2019

@thomas-stockx Is there any documentation on the postMessage method? How to call it in flutter and how to accept the message in Unity. I can't find an example in the example project.

it only shows the use of the resume() and pause() methods.

I want to send my data from the inputfield fields and the value of the selected button to Unity, so I can create an account there.

@thomas-stockx
Copy link
Collaborator

@rafbanaan #31 (comment)

@rafbanaan
Copy link
Author

Got it working, thanks for the help!

Might be useful to put that example in the readme? Together with an example for unity to flutter?

@AkhilRaja
Copy link

@rafbanaan I believe this will not work for now and it's not an issue from unity, I am suggesting you use events to show the keyboard and see if input works ok

Is there an update on this? My use case requires me to take user input from a unity view in iOS. Do you have a workaround for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants