Use touchscreen as mouse input

Hello! I need a simple feature for my game. For now, I have a mechanic where the player can pick up an object and rotate it. The object can rotate when the player holds down the left mouse button. The object can also move farther away or closer to the camera if the player moves the scroll wheel.
I want to make it so people who play on phones (specifically Android) can use touch input in order to rotate the cube, or the basic zoom-in and out gestures in order to bring the object closer or farther away. Here is some code I wrote:
This is the inspection screen


This is the code for the mouse moving the object

Screenshot_391
This is the code for the mousewheel


Any help is appreciated!

For Picking up you can try GetHitResultUnderFinger function. To rotate around and other stuff you need to manually calculate it using positions passed from touch events.

Could you guide me on how to create the rotating and zooming functions? I already did the pickup part

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.