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 Luci85 · May 29, 2012 at 02:02 PM · multitouchmulti-touch

Getting started with UniTUIO

I'm developing a game for Windows Surface and I'm trying to integrate multitouch inputs. I know that Unity doesn't support native multitouch inputs (right now), so I thought to use UniTUIO. But there's next to no tutorial on how to use it out there. Has someone experience with UniTUIO and could show me the ropes?

In addition to that, I'm using MultiTouchVista to simulate a multitouch enviroment(using 2 mices) for development purposes(as I can't develop on the Surface). So I want to know if those to things can go hand in hand.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Luci85 · Jun 12, 2012 at 01:22 PM

So after some researching, testing and putting together I got it to work.
1. get Touch2TUIO ( http://dm.tzi.de/touch2tuio )
2. If you don't have a multitouch display, but still want to develop multitouch applications, get MultiTouchVista ( http://multitouchvista.codeplex.com )
3. get the uniTUIO demo scene ( http://xtuio.com )
4. Now take the iPhoneEventManager from the demo and integrate it into your scene (deactivate the ConvertTouchToMouse Option). Don't forget to grab all other scripts from the scene.
5a. As I developed in UnityScript I had to use some tricks to get the touch position data. I used the BBCrosshairController prefab as a starting point. Then I added a Touchconversion script onto the prefab, which translated the touch into my UnityScript world. (basic touch informations like the phase and the position)
5b. If you use C# as scripting language you can just use the iPhoneInput class, which now has the fake touchs inside.
6. To test your application, (start MultiTouchVista for multimouse to multitouch emulation, then) start your application, then (very important) start Touch2TUIO in a command window with you application name as argument. And now you should have a working multitouch solution.

Some hints:
-unitTUIO isn't build for multi camera games (aka splitscreen), but if you change
BBInputDelegate updateEvent()

 anEvent.screenPosition = new Vector3(cursor.getX() * Camera.main.pixelWidth,(1.0f - cursor.getY()) * Camera.main.pixelHeight,0.3f);

into

 anEvent.screenPosition = new Vector3(cursor.getX() * Screen.width,(1.0f - cursor.getY()) * Screen.height,0.3f);


and the same for cursorDown(), you will get touches above all cameras.
-if you are like me and developing in UnityScript, give the blursor prefab a new layer, faketouch for example, then you can just use

 fakeTouches = GameObject.FindGameObjectsWithTag("FakeTouch");
 for(fakeTouch in fakeTouches)
 

to get all active touches (check the enabled state or delete the blursors inside BBCrosshairControll if there is no touch). Remember the blursor is in viewport coordinates so you have to translate it into the screenposition.
-TUIO applications are always in fullscreen
-if you compile your application remember the settings (32 or 64 bit) and use the appropiate Touch2TUIO exe

Comment
Add comment · 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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Attaching Scripts to GUI Components 1 Answer

Move 2 objects at the same time 0 Answers

uniTUIO touch delay 0 Answers

How to have multi-touch with Canvas buttons 0 Answers

I try to Create a DLL for get WM_TOUCH windows message! 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