A very common input device in computer games. It offers a more direct form of movement compared to directional input.

learn more… | top users | synonyms

12
votes
6answers
1k views

How to properly differentiate single-clicks and double-click in Unity3D using C#?

What I am trying to understand and learn here is a very basic thing: what is the most general and most polished way to properly differentiate single-clicks and double-clicks for the 3 main mouse ...
1
vote
0answers
29 views

How can I get UI element over which pointer is in Unity3D?

I can detect if mouse is hovering any UI element by EventSystem.current.IsPointerOverGameObject(). But how do I know which GameObjest it is exactly? I have tried: if (EventSystem.current....
3
votes
1answer
62 views

Selecting the closest point in perspective view mode

I'm trying to improve my algorithm for selecting points in perspective view mode (OpenGL/Qt/C++). The current implementation works as follows. The user clicks on a certain (x,y) position (in Window ...
2
votes
2answers
418 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = Display....
6
votes
4answers
577 views

Get OnMouseDown to work with a 2D Polygon Collider

I'm having a hell of time getting a 2D polygon collider to register a mouse click. I've attached images and code to show where I'm at. I cannot get the click to work. Ultimately, the thing I'm trying ...
1
vote
2answers
68 views

Sending a players mouse movement to the server in an FPS

So I have a server-client model FPS set up. It uses udp to send data between the two with the server having a constant tick rate of 100 ticks per second (It updates movement 100 times a second) on the ...
0
votes
1answer
48 views

How to move 2D objects based on mouse movement with pointer locking?

I'm using pointer locking for a 2D game (where you perform calculations based on the delta in mouse positions from frame to frame). I'm having some basic math/logic issues with accomplishing what I ...
1
vote
1answer
27 views

Setting up a custom cursor image in LWJGL 3

How can I load a custom cursor image with LWJGL3? It took me a while to figure this out. Here is how it is done for version 3.0.1. Hope this helps.
2
votes
2answers
82 views

object smooth orbital limit around another object depending on mouse drag

I am working in Unity. I have special objects that can each be dragged freely around in 2d. The objects cannot get too close to other objects (minimal Vector3.distance allowed is 1.5f). I also have ...
1
vote
1answer
71 views

In Unity, Change which mouse button is used to scroll in ScrollRect

I've created a new ScrollView in Unity. How do I change which mouse button is used to scroll in ScrollRect (through script or in the editor). By default it's the left mouse button. I'd like to be ...
0
votes
1answer
21 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 ...
0
votes
1answer
27 views

How to get which gameobject the mouse is over in Unity?

So I'm working on a simple drag-n-drop based trading card game for my own amusement. There is a card inspector included. What I want to achieve is to change values in the inspector (which has its ...
-1
votes
1answer
82 views

Game Maker Studio - Check Collision With Subimages

I have an obj_roulette, which contains 4 subimages, with value 2-5 and image_number 0-3. The value result from roulette stored as var global.roulette. Then, I make many obj_meteorite, which contains ...
-4
votes
1answer
21 views

Problem in moving object on movement of mouse cursor in unity [closed]

I was watching a tutorial on how to move objects on mouse movement. https://youtu.be/7OJQ6MbHuvQ this is the link to that tutorial and below is the error I got while scripting. Pleas watch the whole ...
1
vote
1answer
64 views

Unity 5 - Mouse Disappears during runtime

My mouse cursor disappears during runtime. When I click esc, it appears and the moment I click on something, it disappears again. This is what I have done so far to fix this. I have added this to a ...
0
votes
0answers
10 views

Flash Menu - Show image in an specific coordinate

I have a custom mouse and two buttons and I'd like to when a I click in the button it shows an image (a bullet hole in case) in my mouse coordinate (like if the button had been shot)! Thanks everyone!!...
3
votes
0answers
34 views

Calculate Relative Mouse Movements Regardless of position

Context I'm working on making a variant of the atari game Breakaway IV and I'm trying to improve my mouse input handling. I use the input of a mouse's motion left and right to move the bumper. ...
0
votes
1answer
77 views

Boolean change when clicking the left mouse button (not working)

I want to change a boolean when I click the left mouse button, but it doesn't work as expected. I use this method: if (m.LeftButton == ButtonState.Released && m_Old.LeftButton == ButtonState....
2
votes
2answers
87 views

Camera movement in unity engine

I have a basic camera setup which is angled like so: x: 30 y: 0 z: 0 Projection: Orthographic And i attached a C# component to it and made it so the camera moves with a right click and drag ...
1
vote
1answer
40 views

Help with open and close UI Menu on background mouse click

I am trying to make a point and click game in unity 5.2.2. My problem is that I need to have a UI menu to open, when the player clicks with the left mouse button on the background sprite, and it ...
3
votes
1answer
2k views

How can I change the appearance of the mouse cursor in libGDX?

How can I change the mouse a cursor to a picture using libGDX?
0
votes
0answers
38 views

How to set cursor position to middle of screen while still being able to change the Delta-X

I have this code: @Override public boolean mouseMoved(int screenX, int screenY) { float deltaX = Gdx.input.getDeltaX(); camera.rotate(Vector3.Y, deltaX * -0.3f); Gdx.input....
1
vote
2answers
81 views

OnMouseClick not detected

I created "main script" and in Start() created simple cube: GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.transform.localScale = new Vector3 (1,2,1); cube.GetComponent<...
1
vote
1answer
114 views

What algorithm is used to select a voxel (from a player's perspective)?

In first-person voxel games (like Minecraft, shown below) you can select voxels by going over them. What kind of algorithm is used to select a voxel? I haven't implemented it in my voxel ...
0
votes
2answers
84 views

Detecting Left and Right Mouse clicks on UI Text objects that are dynamically created

So, in my game I create a bunch of UI Text game objects dynamically (in the C# script), but I just can not find out how to properly detect Left and Right mouse clicks on these UI Text that were ...
2
votes
3answers
297 views

Unity Click make Jump and Pause

I use Unity 5 and I have an issue with my game, when I click on the Pause button my character jumps before the game is paused. My script detects the click for jump before the pause button so for that ...
2
votes
1answer
227 views

How to disable camera moves (mouse drag) in an Unreal Engine editor plugin?

I tried to override FEdMode: virtual bool DisallowMouseDeltaTracking() const override { UE_LOG(LogTemp, Warning, TEXT("do not allow mouse delta tracking!")); return true; // I also tried to ...
2
votes
1answer
246 views

How to get the mouse events in an unreal engine editor plugin?

I would like to react to user inputs in an editor plugin, how can I do that? In a game I can use a custom Pawn or a custom PlayerController but how can I do it in the editor?
2
votes
2answers
124 views

Combining two independent rotations relative to the world frame

I am implementing a mouse rotation which works by accumulating the X-Y delta between frames to yaw and pitch rotation angles. The problem is that I wish rotations to be independent of each other. But ...
2
votes
1answer
60 views

Isometric Mouse Camera Panning

I am building an isometric game environemnt and i want to be able to pan the camera around the map by holding the right mouse button, can someone talk me through the logic for this please, i have made ...
3
votes
1answer
669 views

How to get direction and velocity of movement of an object dragged with the mouse in Unty (C#)

I have an object that is dragged by the mouse (X and Z positions) over a table, with the following simple code: Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if(Physics.Raycast(ray, ...
7
votes
2answers
281 views

How do I create a draggable object which snaps to obstacles in the way?

I bring yet-another-drag-with-mouse question (I am using Unity with C#), but with a less common particular detail: the existence of obstacles in the middle of the way trough which dragging occurs (3D ...
9
votes
4answers
8k views

Trap mouse in SDL

How can I trap the user's mouse inside my game? It's not a fullscreen game, but I want it so that the user cannot drag the mouse to outside the screen. Do I have to check the coordinates of the mouse ...
0
votes
0answers
36 views

BulletScript-Unity

I'm basically making an fps game in Unity. I have a player with a gun and i have a bullet prefab. I changed the mouse pointer to look like a crosshair. Now i need to know the C# script to make the ...
0
votes
2answers
4k views

How to detect mouse over for UI image in Unity 5?

I have an image that I have setup to move around and zoom in and out from. The trouble is the zoom can be done from anywhere in the scene, but I only want it to zoom when the mouse is hovering over ...
2
votes
1answer
183 views

convert mouse coords to zig-zag isometric

I was wondering, how do I convert mouse coordinates to zig-zag isometric coordinates? I already know how to convert to isometric using the Diamond approach, so I just need to know about the zig-zag ...
2
votes
1answer
100 views

My bullet changes the velocity depending on where I click

I want to build a little 2D-Sidescrolling shooter and I'm now at the shooting script. I already figured out how to shoot a bullet towards my mouse pointer. I got something like this : Vector3 ...
0
votes
1answer
139 views

Getting mouse movement value with DirectX Tool Kit

today I want to ask a question about how to get mouse movement value with DirectX Tool Kit. While I can certainly use Mouse::SetMode(MODE_RELATIVE), to do this, I want to be able to get the mouse ...
1
vote
0answers
321 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/...
0
votes
2answers
243 views

Need Help with Hovering Mouse Code

I am new to Unity and C#. I have a script here for a card game where my card is supposed to move up and down when the pointer is hovered over the card. But when my point hovers over each card, they ...
-1
votes
1answer
86 views

Camera rolls instead of looking up and down

I got a small script from the official Unity forum which is: public class MouseRotationUpDown : MonoBehaviour { public float RotationSpeed = 5; void Update () { transform....
0
votes
0answers
239 views

how to move an object to the mouse in Java

I have just recently started using Java, literally 2 days ago, and I have run into an issue. While I have been easily able to figure out most of the syntax and methods, because I have used multiple ...
1
vote
0answers
130 views

Unity: Finding out where OnSelect comes from

The new UI EventSystem method OnSelect is called from a number of different sources. One is when the Selectable is selected by using the arrow keys to navigate. Another is when clicking on the ...
7
votes
1answer
119 views

How can I keep the clicked point under the mouse when rotating? (GLM)

I have a spherical mesh of radius 1, centered at (0,0,0) in world coordinates. I want to rotate the sphere so that the clicked point remains under the mouse at all times. However, I cannot find an ...
1
vote
3answers
664 views

Problem getting mouse events while keys held down in SDL2

I'm attempting to write input capturing code using SDL2 on Windows. However, I'm running into a problem. Whenever a key is held down, the SDL event queue has no mouse movement, nor will the mouse ...
2
votes
1answer
450 views

Problem, why the mouse cursor position is totally wrong, after resizing the window?

I come here, because i'm trying to add some "menu" interface in my small XNA Game . I found on internet a nice library adviced by many devellopers. Till now everythink is ok, the problem is my C# code ...
1
vote
1answer
7k views

Looking at the mouse position in a top down Unity game?

I'm trying to make a simple top down game where the player looks at wherever the mouse is pointed. The player is only going to rotate on the Y axis. Here's what I have so far but I can't seem to get ...
2
votes
2answers
986 views

Making mouse pos realtive to a moving object

I'm coding my first actual game, trying without following tutorials, just trying to use my knowledge so far to make something playable. I'm creating (attempting) a simple side-scrolling shooter. I ...
1
vote
1answer
830 views

Java: See if Mouse is hovering/clicking Sprite

The game I am developing is in which you defend the Cell from the Viruses, and I need the sprites to have a MouseListener for when the mouse clicks on that sprite, it will get destroyed, and I cannot ...
1
vote
1answer
565 views

Unity3d - move 3d object in an AR scene

I have an AR scene that has one AR camera, an image target and a 3D object as below. I want to move the AR object to the position of the mouse click. I have tried taking the Input.mouseposition (...