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
0answers
7 views

What is causing my `touchstart` event to end whilst I'm still 'touching' the screen and how can I fixt that?

I hope someone can help as I am having problems with touch events. What I'm trying to do: I'm trying to add touch controls to games created with the html canvas and JavaScript so that they can be used ...
0
votes
0answers
18 views

Unity touch position infinity

When I try to get the touch#1/position [Touchscreen] I receive as value (Infinity, -Infinity) with the new input system of Unity3D My settings are Passthrough and Vector2 as expected value. The ...
0
votes
0answers
48 views

How do I write a script for Unity that allows a gameobject to be scaled using pinch & zoom touch controls?

I need a script for Unity that allows a gameobject to be scaled using pinch & zoom touch controls. I have found lots of answers for scripts that cause the camera to zoom in/out but I want a ...
1
vote
0answers
24 views

Touch phase is moved when touch pressure changed

I am trying to scale my object by a finger touch just like in Jelly Shift game. It should scale up/down when I move my finger up and down and it should stop when the touch is in stationary phase. The ...
0
votes
0answers
22 views

How to fix controllers using InputSystem.EnhancedTouch on iOS in Unity 2021.2

I updated my game to latest tech release (2021.2) and everything seems to be working totally fine (in the Unity editor). However once I build my game to iOS, all controllers that are using ...
0
votes
0answers
12 views

How to smoothly move in FixedUpdate using touches on mobile?

I have a serious issue for over a week now and no matter how - I can't make it work. I have a simple movement system, where I move the player on the X position: ...
0
votes
0answers
27 views

Lean Touch does not detect input on the Game tab in-editor

I am using the lean touch asset to get input in the game. My problem is: I can get input on the simulator and the phone without any problems, but I can't get any input on the unity editor game screen. ...
0
votes
0answers
5 views

A script to record oculus rift touch controllers and macro the recorded motion to a number on the number pad

i have a question about recording a specific input from the oculus rift touch motion controllers. is there any way to record a certain movement the the motion controllers make then click a button and ...
0
votes
1answer
36 views

Unpausing a game when a TouchScreenButton node is released

I'm making a mobile game in the Godot game engine. I made a spike scene where the spikes will respawn at a random time in a particular position moving upwards. Then I instanced the scene in the main ...
1
vote
2answers
120 views

How to make the character move along the axis using touch?

I have the following code it works, but I don't know how it works. This is the code I found: ...
0
votes
2answers
39 views

Touch control pan 3D map

I'm working on recreating the board game "Hex" as a mobile game. I'm working on implementing zoom and pan features using two fingers. I feel like I managed to get the zoom to work, but the ...
0
votes
0answers
152 views

Unity 2D Player Shoots at my joystick position

Hi I am new to unity and have only a little coding knowledge. Right now I have made my character shoot at my touch position on mobile but when ever I touch the joystick, whick I use to move my ...
0
votes
1answer
58 views

How Do I Separate Dragging My Finger On Joystick And Swiping?

I am currently making a 2D top-down view shooter game for Android, where the game is played horizontally. On the left side of the screen, you can touch anywhere to spawn in a joystick and aim by ...
0
votes
0answers
130 views

Unity 2D - How can I shoot, by swiping up or down, whilst aiming?

I am quite new to Unity and C# (in fact, this is my first project). I am creating a simple 2D top down view shooter game. The game is aimed to be played on smartphones. I have a virtual, fixed ...
0
votes
1answer
727 views

How can I get the speed of finger drag using unity TouchPhase.Moved?

I'm making a mobile game where you control a 3d ball by touch. So far I can get it to roll based on finger down and drag (via TouchPhase.Moved) but I want to be able to detect a fast flick or finger ...
1
vote
0answers
655 views

Disable free look camera movement when touch detected on mobile joystick

I'm using free joystick pack form asset store and in scene have two cameras (first person and third person). Switching cameras with toggle. Game starts with first person camera. Moving with fixed ...
0
votes
1answer
309 views

How to get the fingerID (Touch) that is pressing a specific UI button. (Unity)

I want to displace a button along with the screen position that is pressing on it. However, having multiple touches at the same time results in wanky behaviour. So I want to limit the button's ...
0
votes
1answer
397 views

Touch goes through UI objects on mobile

I know this question has been asked a lot of times, and I have tried the solutions that were provided and I still have no valuable result, so I thought...maybe a new set of eyes could help. I have a ...
0
votes
1answer
116 views

Touch input not working well for mobile game made with Unity 2D

I made a simple game in unity where the user taps their phone screen and the player jumps up. When I test it on my phone (not sure if this matters but it's a Samsung s9+), I tap the screen and usually ...
0
votes
1answer
55 views

Jump when the screen is tapped, rather than when the space key is pressed

I am trying to make my character jump when the player taps the screen. At the moment it jumps when I press space bar, but how can I change the code to make him jump when the screen is tapped? This ...
0
votes
1answer
106 views

In Android, neat way to send input info from `GLSurfaceView` to `onDrawFrame` in `GLSurfaceView.Renderer`?

The input is pinch/drag for camera movement, which modifies a matrix to scale/translate, and sent to a vertex shader. It's working, but ugly. What's the proper way to do it? I've noticed: ...
0
votes
2answers
52 views

How would I make my player controls respond quicker?

I'm working on this game in Unity 2D where the user swipes to make a game object move in the direction that the user swiped in. Currently, when the user swipes it takes about a quarter of a second for ...
0
votes
0answers
558 views

Unity 2019.2.5: Convert Mouse Rotate/Pan/Zoom camera to touch

I have a Unity C# script that uses the mouse to rotate/pan/zoom a camera around a scene with a main focal point (PC Build). It works very well for me, but I need to convert it for a kiosk touch screen ...
1
vote
1answer
240 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. ...
0
votes
0answers
139 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 ...
0
votes
0answers
34 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 ...
0
votes
1answer
174 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
1answer
163 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
1answer
77 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 ...
1
vote
1answer
101 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
1answer
2k 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 ...
1
vote
1answer
705 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
67 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
1answer
280 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
2answers
252 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
222 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
334 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: ...
1
vote
1answer
269 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
215 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
128 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
16 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
247 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
1answer
632 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
823 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
3k 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
3answers
8k 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. ...
0
votes
0answers
1k 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
1answer
889 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 ...
2
votes
1answer
15k 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
73 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 ...