- Home /
Switch Between Touch And Mouse Controls
So I'm trying to publish an app to the Windows store and you need to also have good support for touch. Now, its gotten past certification and some people are reporting they dont have this issue. But some are, even myself on an Acer Iconia.
The way the game is setup to handle Mouse vs Touch is when you pretty the "Start" button on the main menu, it will toggle a boolean value that switches some things.
For example, if you're using a mouse - it will use: Input.mousePosition.x for the cursor.
If you touch it, it is supposed~ to use: var touch = Input.GetTouch(0); touch.position.x
However, some people get this after they touch the Start Button: http://i.imgur.com/3lGpZkt.jpg
Incase that is not readable...
Exception: External component has thrown an exception. Type: System.Runtime.InteropServices.SEHException
Module:UnityEngineProxy
InnerException <NoData>
Additional Info: <No Data>
at UnityEngineProxy.InternalCalls.PInvokeCalls.Input_CUSTOM_GetTouch(Int32 ptr, Int32 param_0)
at UnityEngingeProxy.InternalCalls.Input_CUSTOM_GetTouch(int32 index)
So I'm thinking that even though Im using a touch device, it isn't picking up the GetTouch(0). Its a null pointer for some whacky reason despite the fact I touched the Play button.
The weirdest part is only some people get this issue, it varies on machines with touch. And the NATIVE Unity 3D does not experience this issue. So I'm perplexed. Any suggestions? Is there a better way to handle touch?
Your answer
Follow this Question
Related Questions
Click Two objects At Once Windows 7 Touch 1 Answer
Simulate touch with mouse 6 Answers
Handle Mouse/Touch pan, zoom and click 0 Answers
Disabling touch events on Input.GetMouseButtonDown(1) 1 Answer