Skip to main content
3 votes
Accepted

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

I faced the same issue and found some other solution that could solve it, so probably it will be helpful for someone. Used unity version: 2022.2. First of all, I need to say that I’m using input ...
grbulat's user avatar
  • 46
2 votes

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

Why not use touch phase that is built into unity via the Touch class? ...
user3797758's user avatar
  • 3,641
2 votes
Accepted

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

Here is an example script to answer your question: ...
The Mattbat999's user avatar
2 votes
Accepted

Chain cutting swipe input skips over chains

You are currently experiencing a form of tunnelling. You are checking if touch coordinates move through the Collider's boundaries inwards (outside-inside) or ...
liggiorgio's user avatar
  • 4,885
2 votes

Unable to destroy collider Unity3d

I assume that col1 is also declared elsewhere in the code, otherwise I don't understand how this would've compiled. Notice this line: ...
nihohit's user avatar
  • 595
2 votes

How to know if an actor is touched in libgdx?

Add a Listener to the actor like so. Note you need an InputMultiplexer so your Stage and Screen can both handle touches. Add the Stage first so it gets clicks first, then in the Listener call event....
Niall Quinlan's user avatar
1 vote

Climbing only works with ApplyRootMotion, but this interferes with swiping to jump or slide

The issue was related to ground check. In my script, SwipeUp can make Player jump only when it's grounded. I don't know how but ApplyRootMotion makes my character not fully interact with ground. I ...
Achie1's user avatar
  • 179
1 vote
Accepted

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

...
OC_RaizW's user avatar
  • 1,460
1 vote
Accepted

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

Assuming you're using the Device Input functions, finding out if the user is swiping left or right shouldn't be much hard. In the documentation, about the function ...
liggiorgio's user avatar
  • 4,885
1 vote

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

The solution for this problem is by inserting this code in the touchmove function if(Input.touchCount >= 2){ SetVelocityZero(); } Thank you DMGregory for ...
DeeMastah's user avatar
1 vote

TouchPanel.GetState() Returns wrong touch locations XNA

Okay, well your transformation code is very strange. It looks like you're trying to transform the position of the button rather than the position of the mouse or touch coordinates. The way you need ...
craftworkgames's user avatar
1 vote
Accepted

How to detect long press on object using Unity EnhancedTouch?

A couple of notes: Unless you specifically want to check that the user keeps their finger on the desired object at all times, I would probably only check at the beginning of the touch, as well as the ...
Morten's user avatar
  • 616
1 vote
Accepted

How to check if finger is touching the screen using the Unity input system?

One way is to access the InputSystem more directly. You might be looking for TouchPhase or use the Finger combined with the ...
Morten's user avatar
  • 616
1 vote

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

Try multiplying your offset by your aspect ratio: Screen.width / Screen.height. ...
Evorlor's user avatar
  • 5,832
1 vote

Touch control pan 3D map

I believe what you're looking for is what I refer to as "Google Maps" style panning. This is where the pointer stays perfectly locked on the exact place in the world where you started the ...
Mika Notarnicola's user avatar
1 vote

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

Shortly after, I figured the problem was that I was not implementing the IPointerDownHandler interface causing the IPointerUpHandler to not work. And this is the final script: ...
Venay's user avatar
  • 207
1 vote

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

Your main problem is that you're checking for input in FixedUpdate. FixedUpdate is not guaranteed to run every frame, or only ...
DMGregory's user avatar
  • 136k
1 vote

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

I changed the code to the following by adding a TouchPhase.Began to the if statement: ...
Usmaan Mahmood's user avatar
1 vote
Accepted

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

General Architecture If you had input and rendering share a thread, that would allow you to mix input and output(rendering) code, making it easier to make messy code. What I suggest you to do is to ...
Theraot's user avatar
  • 27.3k
1 vote

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

Waited more than I expected. I found a simple solution for this. ...
Maseed's user avatar
  • 121
1 vote

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

Thanks @DMGregory for pointing this out. Fixed it by initializing xAxisRotation and yAxisRotation variables to camera's start rotations and by changing the target rotation. Initialized those at ...
Anmol Deep's user avatar
1 vote

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

You probably want Rect.Overlap() It allows you to check if one rect overlaps another rect. So you would want to have a rect for the players touch. Which you can crate using the position and radius ...
Douglas Potesta's user avatar
1 vote

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

OK i actually found the solution. I had to use the hit.point variable. Then it was easy: ...
Big T Larrity's user avatar
1 vote
Accepted

How to enable CrossPlatformInput in Unity?

What is "a menu item" and where do I find it in the Unity UI? You know what the File and Edit menus are and where to find those, yes? The package contains an Editor script which adds a new menu item, ...
Draco18s no longer trusts SE's user avatar
1 vote

Touch a specific area on the screen in Unity 5

you're on the right way. now you should create a class that will listen to any clicks on the roulette table, and in the update function of that class you should get the location of the click (either ...
Ido Ben Shalom's user avatar
1 vote
Accepted

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

Consider using a swept collision test instead of just an intersect/overlap test. When doing a swept test, the area traveled is also considered for the collision test, not just the final position/...
bornander's user avatar
  • 4,516
1 vote

(Unity 5) Weird Touch Behavior

Try changing your state integer into a state boolean, as below. [Edit] I added the block to make sure the touch count is greater than zero. All sample code I read does this. Also, your speed in ...
Doug.McFarlane's user avatar
1 vote
Accepted

How to only detect Actor and not background

It the click-handler for the background, make sure you filter out the InputEvents that are already handled: ...
bornander's user avatar
  • 4,516
1 vote

Unity2D - move rigidbody object with collision

This is called arrival. It's a steering behavior. The basic concept is: Apply an acceleration towards the target position (alternatively, you can simply set the velocity if you're not using ...
House's user avatar
  • 73.3k

Only top scored, non community-wiki answers of a minimum length are eligible