Questions tagged [touch]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
107 views

How can I detect whether a point is moving in a circle?

I want to detect if my GameObject (Vector3 Point) being dragged by the player's finger is moving in a circular fashion. I thought I could save the last 5 points ...
1
vote
1answer
21 views

Rotate a 2D object slowly to the touch position in Unity

I am creating a circular Joystick like setup in Unity. Played a lot with it in different ways but I don't get the desired results. ...
5
votes
2answers
534 views

Touch taps only on very short flicks on Win7 with Monogame

I have an application on win7 which needs to support touch and mouse input using monogame. But reading touch taps proves to be a very hard thing. The TouchPanel is initialized like this: ...
0
votes
1answer
537 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 ...
4
votes
1answer
505 views

How do I detect if two sprites are being touched at the same time?

How do I detect if two sprites are being touched at the same time? I was able to detect one sprite, but not if another sprite is being touched by the second pointer. ...
0
votes
0answers
68 views

How to make parabolic jump from a to b to c and so on?

I want to make a game similar to "Dancing HOP: Tiles Ball EDM Rush" I am trying to make an object jump from point a(z=0) to b(z=10) to c(z=20) and so on, keeping the z axis distance constant for each ...
4
votes
1answer
1k views

How can I avoid a delay with continues touch detection in swift?

I want control a character on my screen with a continuous swipe gesture. As soon as I do a swipe +x or -x my character moves ...
0
votes
1answer
110 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 ...
0
votes
1answer
753 views

How do I implement swipe-to-throw in Andengine?

I have a ball sprite and I apply physics to it when the user swipes on it. I'd like the ball to start moving in the direction of the swipe, similarly to how Paper Toss works. How can I do this?
1
vote
1answer
58 views

Quaternion.slerps resets camera rotation to (0,0,0) when i go to play mode help!

i am building a camera rotation script like in fps. Everything is setup and working except that camera rotation resets to zero at the start of game which i dont want. This is the camera rotation i ...
0
votes
0answers
18 views

Add touch screen support to tile navigation

I saw this awesome tutorial that is related to Grid-based Movement in Godot What I want is to add touch screen support for this kind of movement i.e. with virtual on screen joystick or gestures. How ...
1
vote
2answers
1k views

Hold touch at the screen to move object

I'm using unity2D and C#, and I have a code for touch screen: ...
0
votes
0answers
34 views

Why is my TouchScript gesture event not firing?

I am using TouchScript (v9.0) with Unity (2018.2.14f1) and am struggling with getting the Flicked gesture event to fire. I created an empty game object with a few ...
0
votes
0answers
1k views

How to rotate just the object being touched in Unity?

For my first steps in Unity I am just trying to rotate some squares when I touch them. ...
0
votes
1answer
1k views

In Unity for Android, how do I create touchable buttons?

I'm making a test game for Android in Unity 5, and I want to add left-right control buttons like the circles below, to move an object left or right. (source: raywenderlich.com) How can I do this? ...
0
votes
0answers
32 views

Error comparing Input.GetTouch () .phase with TouchPhase.Began

In the update method I'm using unity's touch, as you can see in the code. ...
0
votes
1answer
42 views

Unable to destroy collider Unity3d

So I was making an android game in unity3d. I wrote a script to draw straight lines with touch what I do is I first create a gameobject named temp and add line renderer to it and give the line ...
0
votes
2answers
5k 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. ...
7
votes
4answers
47k views

How to move gameobject with touch on Android [duplicate]

I'm trying to make a game where you control a character via touch on Android devices. The player will have two degrees of movement. When you touch the touch screen and move your finger, the game ...
0
votes
0answers
72 views

Unity Touch Pan Orthographic camera

I have written some code to pan in perspective view. I used that code and modified it to make it work in orthographic view. However, the display does not pan as expected. It just goes all over the ...
1
vote
1answer
91 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
309 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
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 ...
3
votes
3answers
2k views

Spot the difference game design help

I'm thinking of making a spot the difference game. But immediately I stumbled over a problem. I'm thinking of storing a "difference area" in the form of a x,y ...
1
vote
1answer
312 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
1k 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
1answer
47 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 ...
1
vote
1answer
410 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: ...
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
votes
1answer
207 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....
1
vote
2answers
111 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
2answers
216 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
119 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: ...
1
vote
1answer
104 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
136 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: ...
1
vote
0answers
12 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
vote
1answer
436 views

Working out velocity/time based on physical pixels moved

In my game I integrate like so: (Please assume all variables to be declared) ...
0
votes
2answers
1k 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 ...
0
votes
0answers
247 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
1answer
392 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 ...
0
votes
0answers
883 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 ...
1
vote
0answers
450 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
2k 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 ...
2
votes
2answers
180 views

Help with Javascript touch button

I tried many buttons but I can't connect them with the (Java)Script. So I made 2 gui buttons: one for jump which was easy because I have an if statement and if it'...
1
vote
1answer
104 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
1answer
3k views

How does Unity input work with touchscreens

I'm trying to make a racing game on android using unity. I want to make a car move forward when I touch an image button like in the picture below. I've already made it work using the keyboard. How ...
0
votes
2answers
1k 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: ...
3
votes
1answer
10k 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
57 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 ...
0
votes
2answers
6k views

How to know if an actor is touched in libgdx?

I am using "Gdx.input.isTouched()" in the render method of my Screen method, to know where is touched, but when the touch is dragged in the screen, it also activates the events i want only when an ...