Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [touch]

An input method used in games; this generally refers to the input used by mobile phones and tablet-type computers.

0
votes
0answers
27 views

How to detect two finger rotation Unity c#

I am trying to achieve rotating an object when two fingers are rotated on the Sensel morph touchpad. ...
0
votes
1answer
83 views

Mapping a Touchinput-device in a 3D World for VR

I have a Touch-Input device which is linked to my Unity Program and a VR Device. The Touch-Input device which is bolted somewhere BUT the position can be changed. I can get the "2D Coordinates" X / ...
0
votes
0answers
10 views

Android SurfaceView - What is the correct approach for Game Object implementing OnTouchEvent?

I am developing a game just for learning. I have a GameView class extending SurfaceView, and a Scene which extends GameView (for evey scene in the game). Each Scene object has a ArrayList variable. I ...
0
votes
1answer
230 views

Unity3D C# Drag object smoothly on it's x axis that's already bouncing

In my scene, I have a bouncing ball that collides with a cube. On each collision the ball returns to the same height. How can I get the ball to smoothly move along the x-axis by dragging my finger ...
0
votes
0answers
10 views

Android/iOs app: How to get input touch on different zones of an image ?

I'm trying to build my first app/game using Unity 3d. I've added an image and i just want to intercept an event when user touch different zones of the image. How can i do that ? Thanks
1
vote
1answer
151 views

How to make a horizontal scrolling menu in Game Maker Studio 1.4?

I know how to place the items you see in the picture, my problem is how do I move them? How do I know if the player is swiping right or left? I made the items with a ...
0
votes
1answer
37 views

How do I set something when 2 or more touches are pressed?

I currently have a working controller with left and right but I want to set the velocity of the character to 0/Stop when 2 or more touches are detected. This is my current working code but I want to ...
0
votes
0answers
54 views

how can i make a text selector on touch move (like word cookies game)

i want to simulate "touch to select" in android studio (like the following picture) if Anyone has an idea please help me. i have a Constraint Layout that contains 25 Buttons So I place the button ...
1
vote
2answers
80 views

Why does my gameobject fly of into the air when the screen is touched?

I am encountering a peculiar problem when updating a piece of code that translates my gameobject left and right based on mobile touch input. To provide context, the platform upon which the gameobject,...
0
votes
0answers
95 views

How can I improve my touch slide mechanic to be more smooth and fluid?

I have the following C# code, but it leaves me with two problems: ...
0
votes
2answers
140 views

TouchPanel.GetState() Returns wrong touch locations XNA

I am trying to make my Desktop game playable on IOS. I have a Button.cs class, which has this code in it: ...
0
votes
0answers
24 views

LibGdx TouchScreen Movement Logic with Box2D

I'm trying to implement some touch screen controllers to my game and i'm having a few issues :( i don't really understand what's the right way to do it, i can't figure out how to press simultaneously ...
0
votes
1answer
70 views

LibGdx Box2D Touch Input Movement

I've created 2 buttons for movement in my game but when those button are being pressed, the character gets basically thrown away and by pressing only once the movement it's continuous and i don't ...
0
votes
1answer
37 views

I'm Dragging object by using touch (mobile) it doesn't stop when hit collider

I want to make object stopped when it hit collider of another object. But it doesn't stop. How can I fix this? - Unity my code is: ...
0
votes
1answer
71 views

Camera follow while dragging object

I am working on Bowlingball game. And when I move the ball left and right by touching or clicking the camera moves, but it also makes ball keeps moving in the same direction even though I just moved ...
1
vote
0answers
10 views

How do I fix these touch events? Events respond if there are 2 fingers but not 1

I am making a simple game of mine mobile-friendly. The goal is to: Make character walk if a touchstart event is sensed on right half of screen. Stop character if a touchend event is sensed on the ...
-1
votes
1answer
138 views

Unity: input axis raw for touch returning fractions

I am not going to show any script, which may make it complicated. In unity ,when I used the cross platform input manager for touch buttons, the raw axis values returned are in small fractions(like 0....
0
votes
0answers
1k views

How to drag a GameObject with touchscreen - multitouch

This is not a question, rather an answer, so I'm not sure if I should be posting differently, but this took me a while so I'd like to share. This is a code that can be attached to a gameObject within ...
1
vote
1answer
234 views

Pressing two buttons on Android with same thumb touch. UI Event Triggers not working. Workaround found

NOTE: See bottom of the question as I have managed to use a workaround which works to press the two buttons at once on Android (thanks to Douglas Potestas help) Ive struggled with this in the past ...
1
vote
0answers
313 views

Pressing two on-screen buttons at the same time, with the same touch - Android Unity Event-Triggers

OK so I have this code working and the methods are being called at the times I'd expected (ie. when the mouse hovers over the button and stops hovering over it) But when I test it on an Android ...
0
votes
1answer
836 views

Problem using Event Trigger Unity to change bool , but bool keeps setting back to false

OK so I have used the Unity Event Trigger many times to check for on-screen button presses for Android games. One example I have made many times is a left and right arrow button, which moves the ...
0
votes
0answers
147 views

How do I move my cube right or left on swipe in unity (C#) on touch input [duplicate]

I have already asked this question, but I didn't get any answer, so I am trying to improve my question and add some more detail. I am trying to create a 3d game in unity. I have a cube in unity and ...
0
votes
1answer
3k views

How to move my cube left or right using touch Inputs (C#) in unity

I am trying to create a 3d game in unity. I have a cube in unity and I want it to move left or right on swipe . It should move to a distance till where user swipe or take their finger off of a screen. ...
1
vote
1answer
102 views

Multitouch controls in Android

Im trying to make make game which is intended to be played with the phone in landscape mode, and the player uses their thumbs to control the movement. The game controls look like this: On the left ...
0
votes
0answers
685 views

EventSystem.current.IsPointerOverGameObject(t.fingerId) - Not working on Android builds - Unity

Ok so I have followed through about 5 tutorials and read over 5 separate forum discussions on the above method. For some reason in my game, the touch the UI button does occur, but the touch is also ...
0
votes
1answer
220 views

How to code dragging of objects in 3d space in Unity (Android/ iOS)?

I have been working for many hours trying to figure this out and i can't so I thought once again i'd trouble you kind folks. Basically I am trying to keep this as simple as possible so I can get to ...
3
votes
1answer
7k views

How to enable CrossPlatformInput in Unity?

I'm new to Unity but not a complete programming novice. I'm trying to use the CrossPlatformInput component from the "Car" prefab from Standard Assets. I can't see ...
1
vote
0answers
53 views

Unity - Touch Input help needed

I'm just starting to learn Unity and I must admit at the moment im struggling linking my code scripts together. Im used to having a main class to work from. I have been trying to implement virtual ...
1
vote
1answer
66 views

How do I tell the difference between tapping and holding the touchscreen?

I have a problem with the Unity game engine. I am making an Android game. I want to move an object by a small distance every time the user taps the screen, but not when the user holds the screen. ...
0
votes
0answers
186 views

Using Windows 10 Multi-Touch Functionality In Gamemaker: Studio

I have a multi-touch monitor that I am using in Windows 10. I am getting visual feedback on the monitor itself that multiple touches are being recognised. However, within my Gamemaker game, I cannot ...
1
vote
0answers
101 views

Handling multiple touches libgdx GestureListener

I've been trying to create a game with two finger gameplay (ie. If your finger is in the bottom 20% of the screen it will move the player along X axis towards your finger, and if you press finger ...
0
votes
2answers
882 views

Touch a specific area on the screen in Unity 5

I am building a Roulette game in Unity 5. I want to place bets on a Roulette table when I touch specific areas on the screen with mouse(PC) and touch(mobile). For example when i touch Number 1 on the ...
1
vote
0answers
131 views

any help using LibGDX Gesture Listener?

I've been trying to use GestureListener to turn touchscreen into the effect of my dpad. It all works pretty much, but the touch-held (or longpress) is not always working. It mostly does work but will ...
-2
votes
1answer
82 views

Can you please help me transform this script to adequate to mobile touch in unity?

My code here works with a keyboard: ...
0
votes
2answers
95 views

Raycasting to AddForceAtPosition goes to the wrong direction

I'm trying to get my coin object's Rigidbody to move whichever way it was swiped on by the user through RayCast ...
1
vote
1answer
374 views

Android: How to prevent player(drag/drop touch input) from moving through non-moving objects?

My player is moved around the screen by touch user input. The user touches the character and drags him to another position. (implemented in touchevent: ...
1
vote
1answer
1k views

Hold touch at the screen to move object

I'm using unity2D and C#, and I have a code for touch screen: ...
1
vote
1answer
97 views

(Unity 5) Weird Touch Behavior

In my (Google Cardboard) Android app I would like to make my camera move on Touch. That movement state should be controlled via a "switch", so when I touch the screen the camera starts to move and ...
1
vote
0answers
118 views

How to update game handle touch input faster

I'm making a LibGDX game where the player needs to tap to jump. But in this game, the player has to tap extra fast because the player needs to jump extra fast. The problem is, the program can't ...
1
vote
1answer
136 views

How to only detect Actor and not background

I'm making a game where I have buttons on a stage, but the background also acts as a "button". But when I press on one of the existing actors on the stage, it also registers a click in the background ...
1
vote
0answers
40 views

How do you stop touch[].phase when using Joystick prefab?

I have a camera that rotates around the player only in x axis when you swipe on the screen. I have two buttons and a joystick prefab on the UI. I don't want the camera to move when ...
2
votes
1answer
857 views

Why does Unity require an EventSystem component for input during a play-test, where input works fine without it in a build?

Please be aware that this was initially a question about how to get the input to work. A comment pointed me in the direction of a fix, but only left me with more questions in regards to understanding ...
0
votes
2answers
913 views

Raycast not working on touchscreen (Android tablet/phone)

I have a raycast that works in the unity editor but not when I build it for Android( tablet or phone, neither work). The code I'm using is as follows: ...
1
vote
2answers
160 views

Unity2D - move rigidbody object with collision

How do I move and collide my object (position given by touch or click), by Using rigidBody2D.MovePosition i can only teleport my character, and by using velocity, my character keeps moving, I want him ...
0
votes
1answer
562 views

Unity 3d - Touchscript Asset: Get object when “touched”

I have a question regarding the exact method for getting the game object that I'm touching. I thought it would be getting the name of the PressGesture once the touch starts...but it returns me a Swipe ...
0
votes
1answer
102 views

How do I select a portion of the window using Love2d

I want to be able to divide the window of the game in, lets say, 3 places, and when the mouse (or touch) click one of those places, execute some code. Do I have to make each portion a button-like ...
1
vote
1answer
82 views

Making Basic Touch Behaviors

I am trying to make Basic Touch behaviors for my game where i want to Pan Camera by Single finger touch. Zoom Camera by pinch With two fingers ofCourse. Rotate Camera by two fingers rotation. Rotate ...
0
votes
1answer
230 views

How can I shoot when I touch the Box Collider

I want to change the Computer Input to Mobile Touch Input, if I press Space Button it shoots but how do I change this [Code] to Touch Input ? I want it to have it into void OnTouchDown() but what do ...
1
vote
2answers
44 views

How do I communicate that something is a tutorial button

I made an (ios) arcade game that is rather unconventional, and as a result many people wont exactly know what to do or what the controls are when they first open it. As a results I have had to add a ...
1
vote
2answers
680 views

Get world position of touch on objects

In my Unity3d game, I want to get the world position that was touched, when I touch a specific object, regardless of all objects that are in front of it. How would I do that, I only know Camera....