-
Notifications
You must be signed in to change notification settings - Fork 55
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
questions on stackoverflow #11
Comments
You can modify the controller by changing Some details are here. Basically you make messages in some script in Unity and get a "NetPlayer" object. For the HFTGamepad you can get its net player object like this
Then you either send messages from the game (unity) to the controller (javascript) or from the controller back to the game. In your case you probably just want to send single string like this
And you can send it to the controller like this
In controller.js you might have some code like this to receive the message
Of course you need to add some HTML to controller.html to have a place to display the message
And in controller.js you'd need to look that up
You'd probably also need some CSS to position the message in
That's just a guess of course. How you want to display the message is up to you. Maybe you want lots of fancy CSS. Maybe you want to send the CSS from Unity. Maybe you want to pass a color from Unity. Maybe you want to pass time to show it from unity. All of that is up to your game and ideas. And yes you can test by opening a local browser. Just open a browser window and go to |
Ok thanks! I'll have a look at the next game jam! |
I tried to ask a question on stackoverflow using the "happyfuntimes" tag. But since the tag seems not to be used yet, I can create no question with this tag. (You need a certain reputation to create an own tag for questions.)
My question is:
How can I modify the preset controller?
I am using the 2D sample project of happyfuntimes and would like to display the player's score directly on their phone.
Which script do I use to accomplish this? HFTGamepad.cs? controller.js? PhonePlayerScript?
Can I test the controller without connecting a phone to the game? E.g. by opening a browser?
The text was updated successfully, but these errors were encountered: