Questions tagged [touch]
An input method used in games; this generally refers to the input used by mobile phones and tablet-type computers.
181
questions
1
vote
1
answer
1k
views
Android Swipe In Unity 3D World with AR [closed]
I am working on an AR application using Unity3D and the Vuforia SDK for Android. The way the application works is a when the designated image(a frame marker in our case) is recognized by the camera, a ...
1
vote
3
answers
798
views
Getting different x and y coordinates for touched location on a zoomed view
I'm using Cocos2d for developing a game. I need to be able to pan and zoom when necessary, so for this reason I've added CCLayerPanZoom extension to my project. Recently I've noticed a problem with ...
1
vote
0
answers
414
views
Moving an object (pong paddle) along the x,y axis in 3d-space with mouse/touch
First of all: Sorry, my English isn't quiet good, I'm very new in 3D and I'am using JMonkeyEngine.
What I would like to do?:
A 3d pong game and I want to control the paddle with the mousecursor and/...
1
vote
1
answer
645
views
GestureListener's fling method doesn't get called
I'm using SimpleGestureDetector from the libgdx-users Wiki as my InputProcessor. I set it in the ...
1
vote
1
answer
715
views
How can I scroll sprites when swiping using Cocos2D?
I'm adding 3 sprites (layers) to CCParallaxNode:
...
1
vote
1
answer
93
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
1
answer
56
views
How to enforce touching within a ring shape?
I'd like to have the player moving the finger within the shaded ring:
The game should be able to detect "out-of-boundary" events once the finger moves outside the ring. How can I accomplish this?
0
votes
2
answers
848
views
What is the best practice for handling touch events on different GameObjects in Unity2D?
First of all I want to describe what I have in my scene.
1. Joystick.
2. Main character that has link to joystick and handles touch events from joystick.
2. Buttons.
3. Other GameObjects that must ...
0
votes
2
answers
221
views
How do I achieve one touch one shot for WP7 game?
I want to be able to have a sprite shoot in a game for WP7.
What I have at the moment is that as long as the shoot button is held down the sprite constantly shoots.
How do I sort it that only one ...
0
votes
1
answer
486
views
Drawing an arrow cursor on user dragging in XNA/MonoGame
I am writing a touch enabled game in MonoGame (XNA-like API) and would like to display a an arrow 'cursor' as user is making a drag gesture from point A to point B.
I am not sure on how to correctly ...
0
votes
1
answer
103
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
2
answers
226
views
Touch through GameObject, best practice
in the game I am doing atm you have an area with monsters.
There are two modes to damage monsters :
tapping on them
casting spells on the ground
Tapping and damaging a monster works fine.
The ...
0
votes
3
answers
3k
views
How to flick gameObject using Touch?
I've been searching for a solution for my problem for a while on the web, but i didn't find anything that work properly
What i want to do
I have a bouncing ball and I want to let the user flick it ...
0
votes
2
answers
916
views
Simple LibGDX Pong game drag player instead of getting x position
I got a working pong game in LibGDX but when I touch the screen the player x automaticly jumps to the coordinates I touched. I wan't my game to detect I touched and then move the player to the left/...
0
votes
1
answer
225
views
How to detect long press on object using Unity EnhancedTouch?
I want to implement a feature in my mobile game where if you press on a game object for a certain amount of time while not moving your finger an animation will play. I also need to be able to drag and ...
0
votes
1
answer
2k
views
How to check if finger is touching the screen using the Unity input system?
I have a While loop that runs when the mouse is pressed and it look like this:
while (mouseClick.ReadValue<float>() != 0)
{
//Do something
}
This works ...
0
votes
2
answers
206
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
1
answer
1k
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
1
answer
635
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
1
answer
273
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
1
answer
207
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
1
answer
339
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
1
answer
120
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
1
answer
772
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 ...
0
votes
2
answers
405
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
2
answers
2k
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
1
answer
239
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 ...
0
votes
1
answer
1k
views
Handle two different touch gestures at same time without overlapping
I'm trying to create a Character touch controls for 2d platform.
In my script Im using one horizontal swipe and hold touch gesture and one vertical swipe gesture without hold.Both are different ...
0
votes
1
answer
630
views
Swipe and hold character movement not working
Heres my PlayerControl script
...
0
votes
1
answer
3k
views
OnMouseOver() alternative for iPhone (Unity3D/Unity2D)
I am currently developing a game that uses the OnMouseOver() function of a MonoBehaviour object.
Is there a true alternative for iPhone? Would I be better of coding my own?
Thanks in advance
0
votes
1
answer
860
views
Touchscript: multiple overlapping colliders
Im building a tower defense game on unity and would like to allow the player to pan the camera on a large map. I am using touchscript to handle the touches.
I made a testing project with the ...
0
votes
1
answer
2k
views
Libgdx Actor touch undetected
I am looking for detect touch in an actor. The touch in my game is detected in wrong part of the screen. I want to detect touch only on the red circle, here is the code:
Static_values
...
0
votes
1
answer
1k
views
Libgdx detect touch on a specific object (while moving) [closed]
I have a class (I'll call it with letter "A") and class B.
A is the object (as a character) and B is the rendering class which have the aim to show A.
I am looking for a way to detect when A is ...
0
votes
1
answer
291
views
0
votes
2
answers
874
views
Touch sides of tablet, moves that direction
I am making a game where the player flies a balloon through a cavelike structure.
I am having trouble making him fly correctly when I try it out on my android tablet, seeing as it requires different ...
0
votes
1
answer
63
views
Implement an action "while" touching event
I'm making a game using Xcode for iOS. This is a segment of code I have that makes the sprite jump up when the screen is tapped:
...
0
votes
1
answer
124
views
my movement is working good on keyboard but on android its not
So basically here is what my movement is like for keys:
key down
if (keycode == Keys.LEFT) {
mishi.getAcceleration().x = -13;
}
key ...
0
votes
1
answer
73
views
Concurrent touches not being detected
I have pretty much the same controls on the race example of the engine. A AnalogOnScreenControl and a button defined by a Sprite....
0
votes
1
answer
376
views
Touching a CGRect
In my cocos2d app I am trying to determine when a CCSprite is touched
Here is what I have:
...
0
votes
1
answer
484
views
Where does touch control logic go?
I'm creating a game (or app, depending on how you would define it...) where I'm moving objects (with sprites) on the screen.
I've got this to half-work in both scenarios, but I can't seem to get it ...
0
votes
1
answer
33
views
Sawblade's spin stops or jitters when swiping to steer it
I have a 3D object, a blade, that I want to rotate continuously
on the x axis, like it's cutting through something.
I also want the player to control its z-axis rotation by swiping.
It's mainly ...
0
votes
0
answers
54
views
How can I clearly distinguish between tap and swipe inputs on mobile?
How can I clearly distinguish tapping and swiping touches?
This is my interaction script:
...
0
votes
1
answer
73
views
Pass input event from stage to added actor
I am diving into libgdx and used their sample game as a starting point.
I also added a touchpad to move the bucket. That was kind of easy and worked flawless.
My additional idea was to make the ...
0
votes
0
answers
302
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 ...
0
votes
1
answer
59
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 ...
0
votes
0
answers
324
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
1
answer
543
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
0
answers
260
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
1
answer
1k
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
0
answers
956
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 ...