Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Corandy · Jun 11, 2012 at 12:07 PM · javascriptmobileconnectiondesktop

How to have Mobile Input for a desktop game in Unity

I'm a beginner with Unity3d and I am using javascript.

I want to have Mobile input (Android or IOS) to trigger events in my Unity on my laptop. Is this possible? And how can I achieve it?

I was thinking about to press a button on the smart-phone so it sends a message to the unity program and triggers an event.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jessica_Ann · Jun 11, 2012 at 02:35 PM 0
Share

could you explain just a little more what you are trying to acomplish? You cant duplicate multi-touch input thru a laptop but key presses you can.

avatar image Fattie · Sep 26, 2012 at 11:05 AM 0
Share

http://getjoypad.com/

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Julien-Lynge · Jun 11, 2012 at 04:05 PM

So as I understand this, you want to have two Unity applications running, one on the laptop and one on the smartphone. The smartphone application takes input from the user (and presumably has some sort of GUI), and sends the input in some serialized format to the application running on the laptop.

It sounds like you want to do all the logic on the laptop, rather than doing the logic on the smartphone and directly calling methods on the laptop. Unity provides the touches from the user as a struct, but unfortunately these are read only values - you can't create a Touch yourself on the laptop.

One option is to create your own Touch struct that has the same fields as the built-in Touch struct but is read/write - perhaps call it MyTouch. Then, rather than having your code act off of Input.touches, you create an array of your MyTouch struct and use myTouches instead. The rest of your code would then be written as if you were getting the touches directly from the laptop.

Alternatively, there are third party tools that will deal with touch fakery. One we've used in the past is UniTUIO Community Edition.

Either way, your strategy would be to have an Update() function on the smartphone that looks for input. You would then serialize and send this input to the laptop (via RPC, a backend like SmartFox, or directly with sockets). The laptop would turn these messages into fake input, and from there everything would run as if it were a smartphone.

Good luck.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Fattie · Jun 11, 2012 at 07:49 PM 0
Share

Julien, regarding precisely your first paragraph, it si all DONE by these guys. http://getjoypad.com/ which is fully unity integrated. you can have it working in 2 $$anonymous$$utes .. it's pretty impressive really.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

WebGl on UC Browser 1 Answer

How to make an object move relative to the finger 1 Answer

2 Triggers, 2 scripts, need help communicating the two. 1 Answer

Get status of GUI button 1 Answer

How to get a rice paper effect for a texture 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges