- Home /
testing touch function on pc instead of on phone
Hi. I have a problem. I'm not able to connect my phone to my PC and then run the game in the editor and test it live on my phone and some people are able to. I have to build it, install it on my phone and run it then. I'm currently working with Input.touch and I wonder. Is there a method to make the mouse act as a finger? So I can be able to touch the "screen" with the mouse somehow and be able to test my game in the editor which is much quicker?
Scream at the Unity developers to make Unity support touch input on Windows 8 touchscreen devices already ffs.
Wait for hell to freeze over.
Then get a Windows 8 touchscreen device, and test on that.
You can't even test actual touches on a touchscreen PC, so Unity REALLY needs to incorporate touch recognition in the development environment play mode at the very least.
It seems like that would only really be useful when using a Surface tablet when developing a Surface game? The Unity $$anonymous$$m does a good job not working on things very few people use. I feel like touch-PC's are one of those. I'm thinking they didn't sell all that well, so not a huge market for games on them; and if $$anonymous$$icrosoft really wanted Unity support, they'd have sent a guy over.
Answer by xandermacleod · Dec 14, 2013 at 05:29 PM
There's not any obvious way to do it short of plugins; however if it does help Input.GetMouseButtonDown(0), Input.GetMouseButton(0), and Input.GetMouseButtonUp(0) register taps the otherway around.
I tend to write my touchscripts with a mouse version afterwards in order to test stuff. Sorry that its not the answer you'd like to hear. :(
Thanks ;) With this I'm able to test it without having to build the game all the time ;)
it's good answer until you need to test swipes and dragging objects... :) $15 will save you a lot of time of coding and debug something you event don't need for the final product... good luck!
Answer by haim96 · Dec 14, 2013 at 04:57 PM
can you "Build and run" directly from unity? if not, make sure your device have the correct driver in device manager. (assuming you got android + windows). after that your should use remote app on your device but it's not very good and the best option is always test the app on real device. for simulating screen touch with mouse i'm using easyTouch plugin. it's not free but work really good.
Answer by Owen-Reynolds · Dec 14, 2013 at 06:01 PM
I've found there are enough differences device vs. PC that you have to test a real build on the device anyway. For examples, accounting for the finger being fatter than the mouse and hiding more of the screen; accidental 2nd fingers; general "feel" of an often slower framerate.
Answer by emotitron · Oct 10, 2016 at 05:14 AM
You can do builds from Unity and have them run, but it takes up to a minute or more (depending on the current project size) to compile, copy to your test phone, display the unity logo and actually start playing. Messing with complex touch interactivity involves hundreds of these kinds of tests to make sure that your touch logic is right. That is a lot of time staring at a progress bar.
PC developers would definitely use touch displays to develop the touch components on if the option was available. Being able to instantly test touch functionality while in play mode would dramatically cut down on development time for complex touch interactivity - primarily multi-touch programming.
As it is, all development is done on PC and Apple machines, but a huge amount of final product is touch based. Unless there is some complication that prevents getting touch events in play mode from windows (and macs if Apple ever allows a OSX touch enabled monitor) - it would definitely be embraced by developers. Developing touch apps without a play mode to test code in is a real problem - one that should be relatively easy to fix. The only reason I can see for not is because it currently is PC specific - and Unity may not like the idea of giving the PC a function the mac doesn't have.
We aren't looking for a perfect touch play mode here, but having it ignore touches completely seems like a giant unnecessary oversight.
Couldn't this just be solved with having an option along the lines "Simulate finger touch with mouse in play mode"? I'm completely new so I don't know much yet, I was just sitting here looking for exactly that option though, I thought that was an obvious function to have.
Your answer
Follow this Question
Related Questions
Is there a way to emulate a touch in the Game view of the editor 1 Answer
Standard Assets disappears in somes Android Phones 0 Answers
How to Touch Drag 3D Objects 2 Answers
android touch not detected. 1 Answer
Touch joystick tutorials ? 0 Answers