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

0
votes
0answers
8 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 ...
1
vote
1answer
392 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[] = ...
0
votes
1answer
35 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 ...
3
votes
4answers
393 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 ...
0
votes
1answer
32 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 ...
3
votes
0answers
28 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
60 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 == ...
2
votes
2answers
64 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
34 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
24 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); ...
1
vote
2answers
68 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); ...
1
vote
1answer
110 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 ...
9
votes
4answers
445 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 ...
0
votes
2answers
54 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 ...
1
vote
3answers
221 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
168 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
181 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
115 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
56 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
269 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
227 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
2k 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
103 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
99 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
115 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
311 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 ...
0
votes
0answers
232 views

Object Rotation with mouse around his axis using Quaternions

I faced a couple of days ago a gimball lock problem , trying to rotate an object on openGL 2.1. I have done some researches and found out that Quaternions could help me. So I implemented the class ...
0
votes
2answers
203 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
77 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 () { ...
0
votes
0answers
167 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
108 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
116 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
583 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
316 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
969 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
751 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
490 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 ...
1
vote
2answers
802 views

Detecting a click on a tile

I'm making a simple tile-map system in LWJGL, and I'm trying to figure out how to detect if the mouse is clicking inside of a tile. So far no matter where I click it's always the same tile that is ...
5
votes
2answers
5k views

How do I read input from multiple keyboards/mice on one computer?

I want to be able to read inputs from multiple keyboards and still differentiate them. It's for split-screen. I know it's possible, because Serious Sam 3 allows it. Edit : Well a whole lot of my ...
2
votes
1answer
412 views

Game Maker Studio - how do I disable mouse click for a duration of time?

I Have a button that starts in a rest state, and then after clicking on the button, it animates out. I want to disable the mouse click for around 30 steps after the button has been clicked, otherwise ...
2
votes
2answers
2k views

LWJGL multiple keyboard/mouse input checks

As in many game libraries such as LWJGL, you can check mouse/keyboard events with Mouse.isButtonDown or Keyboard.IsKeyDown. I want to check for button/key presses, not if it's currently pressed down ...
0
votes
1answer
128 views

Java LWJGL - How can I click to interact with objects?

I want to be able to click on a monster to walk to him and start attacking him. The part that doesnt make sense to me is the conversion between the mouse position, and the actual terrain position. ...
0
votes
1answer
72 views

java Move vehicle towards the mouse

Hello I have a game like asteroids and I have my ship on the screen and he points towards the mouse. I want to know how to move towards the mouse so if I press w I will drive towards the mouse and if ...
0
votes
1answer
76 views

Fps independent rotation [duplicate]

I'm trying in my game to have camera rotation speed idependent of fps. For keyboard it works without problems but not for mouse movoment. At 60 fps it works good but at 200 for example rotation is to ...
1
vote
1answer
110 views

Semi-transparent mouse cursor on Windows

I want to change the mouse cursor for a desktop game I am writing with libGDX. That is working well under Linux, however, under Windows semi-transparent cursor pixels are not being rendered at all. ...
0
votes
1answer
83 views

Pygame 2D Vector Math Mouse Input

The following code is supposed to move a player sprite (in this case it's an 8x8 red square) to the coordinates of where the mouse is clicked. I'm able to move the square in the general direction of ...