I just started with Unity programming. I have been playing with the controller scripts and basic 3D object movements such as sphere using keyboard control. I could do that.
However, I am having trouble understanding the usage of the touchpad of my laptop for controlling the camera pinch and zoom actions.
If I use the following code in c# to test whether my laptop touchPad is getting detected, it is returning false.
if (Input.touchSupported == true)
print(“touch supported”);
I am using two touches and this is also not working. if (Input.touchCount == 2)
My question is, does the laptop touchpad behaves differently with touch events? or am I doing something wrong? I am trying to use the unity documentation script from here Getting Mobile Input - Unity Learn
Everywhere you see “touch” in Unity it is referring to a touch screen, such as a smart phone screen or a good laptop screen with touch support, not a laptop touchpad.
A laptop touchpad is represented as a mouse. If your laptop’s touchpad (and drivers for it) support pinch/zoom for simulating a mouse scroll wheel then you can capture that with Input.GetAxis(“Mouse ScrollWheel”) or however it is called in your project’s input manager .
Ok. Since the sample code that I am using is using touch events, I decided to use an actual tablet with touch screen and created a build for Android and run it while the tablet USB support was enabled and saw my application getting deployed on Android.
However, I do not see the pinch and zoom code working on the tablet when using two fingers. Can I do a live debugging while using android as a device and running code on it and seeing if the touch related code is triggered or not, like whether the support for touch returns true while I am using the tablet while USB connected to the laptop?