Swipe Controls in Unity C#

Hello,

I am very new to Unity and C# and I am creating a game using swipe controls. So far the game is going well, but I needed to test the swipe controls.

I found some swipe control scripts but I wasn’t sure if they would work or not. However Unity doesn’t allow me to use the mouse to swipe in the simulator area I guess. So it would be a pain to keep having to build this game every time I wanted to test all of the swipes for the different moves in my game. I was thinking it might be possible to just have the arrow keys perform the moves now and switch out those arrow key lines of code later?

What do people do when they run into this problem and does anyone have any swipe contol scripts that I could use? In my game I just need to swipe Up, Down, Left, Right and hold the screen. Depending if the swipe or hold is on the left half or right half of the screen, different things will happen.

Thanks for any help!

Hi Eric,
if you got an iDevice (iphone or iPad is the same) you can download unity remote and test all the touch control directly on your unity window.
If you want a pretty good (and free) up,down,left,right control you can try Prime 31,s UITOOLKIT.

Iguana.

What I did for my game was first made all the functionality using Input.mousePosition. Then once I had my my functionality working I converted it to Input.touchPosition. Since they work almost the same way it was pretty easy to convert the code once the mouse functionality works.

Thanks for the responses!
I will try to use the UIToolKit first and see how that works out.
I am very new to Unity and C# so I am not sure how to go about that.

So I went to this site GitHub - oddgames/UIToolkit: Single draw call UI solution for Unity with multi resolution support and more. and I see it says they have a UISwipeDetector but I couldnt find where they put that script, so I could copy and paste it. Where can I get it and what would I do to set it up?

I haven’t found it yet but once I do, would I have to use any additional scripts they used if I just wanted the Swipe Detection part? They keep talking about how to set up the texture packer but I don’t want that.

Even though I am new to Unity and C#, I have got a good start on the game and its animations. I know I can do this if I just keep going and Unity C# is right for what I am doing. So thanks for helping me out!