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
11 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....
1
vote
1answer
26 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
79 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
64 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 ...
0
votes
1answer
46 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
votes
1answer
80 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
60 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
76 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....
1
vote
2answers
67 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 ...
2
votes
2answers
84 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
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<...
9
votes
4answers
982 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
82 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 ...
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 ...
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
1answer
39 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 ...
2
votes
1answer
59 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
646 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, ...
2
votes
1answer
223 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
243 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?
7
votes
2answers
274 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 ...
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 ...
2
votes
3answers
289 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 ...
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
170 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 ...
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
1answer
138 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 ...
6
votes
4answers
569 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 ...
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
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
85 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
233 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
127 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 ...
2
votes
1answer
443 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
564 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 (...
2
votes
1answer
559 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
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 ...
0
votes
1answer
76 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
80 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
120 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
88 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 ...
1
vote
1answer
295 views

Responding to mouse input on game objects

I'm trying to make a simple button in unity using a cube. My plan is for when the cube is highlighted that it will move towards the camera and be highlighted in a specific color and then when it is ...
0
votes
1answer
134 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
186 views

Mouse position to grid position not working

I have a function which converts my mouse position to grid position in the game but it is not working properly... its slightly off. I have two functions - one which converts from grid to screen ...