Questions tagged [mouse]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

Problem with action mapping

Summarizing my problem well, I need a single button (right mouse button) to do two things. In my project (TopDown) I defined that instead of the left mouse button, the character moves with the right ...
0
votes
1answer
21 views

Where is the part of the code of the mouse click in the TopDownCharacter blueprint?

I have a project where by pressing the B key, the character after a time interval is teleported to a point on the map. I can do this. It turns out that I imposed conditions so that at the end of the ...
-1
votes
0answers
33 views

How can I move the character to the center of the screen when the user clicks with the primary mouse button?

I am a newbie at this and I'm just trying to learn how to do different things. I am wanting to move a character sprite in a horizontal line, toward the center of the screen when the primary mouse ...
0
votes
2answers
145 views

Drag 3D camera with mouse cursor

I have a camera that is moved by changing its X and Z coordinates. However, the camera is rotated, so when an object moves by 1 unit in the world, the number of pixels it moves by isn't trivial to ...
3
votes
3answers
243 views

Unity Round(Circle) Buttons

I have been using unity and C# scripting now for the past 2 or 3 weeks. So yeah i am very new to unity and C#. I wanted to know if there is a way to make a round(circle) button without using the ...
1
vote
1answer
54 views

Player doesn't move smoothly, when trying to follow position between cursor and player

When my player moves, moving the camera looks like the camera is teleporting to the player, and then after loading teleporting again. I want to make it move smoothly. When the camera is following the ...
1
vote
1answer
45 views

Framerate limited by lack of mouse movement? [closed]

Using Torque, it appears that the program is running at around 25fps when the mouse is still, but as long as I keep the mouse moving, the framerate can hit well over 300fps. What in the world would ...
0
votes
0answers
39 views

C++ Mouse picking for ray to plane intersection

I'm making a C++/OpenGL application (decidedly without GLM), and I'd like to understand how to create a ray from the camera eye to the mouse pointer, as well as detect an intersection point from the ...
0
votes
0answers
20 views

How can I handle mouse input and cursor in a WinAPI window?

Hello I'm studying game engine programming, but I got stuck with mouse input. As for now I have only WinAPI window, which has a message pump and processing. For the mouse I used RAWINPUT, but there ...
0
votes
1answer
37 views

Lowering Unity launcher graphic quality settings reduces mouse x turn speed, does quality affect time?

Lowering Unity App quality settings reduces mouse x turn speed, how to fix this? I am not sure why this happens my only thought was time.timedelta is affected by the graphics quality setting in unity ...
0
votes
0answers
20 views

How to handle mouse to look around (Win API)?

I've made a command prompt game engine. It handles input using Windows Messages, but now I came up with idea of adding mouse input. Currently I wrote a 3D maze game and I'd like to make mouse look ...
0
votes
0answers
31 views

Java game how to fix offset move with mouse drag and reset back to start position

I'm try to make offset x and offset y move correspond with mouse drag movement I tested it. Its work but after I released the mouse and do it again the offset will reset to 0, 0 I tried to fix it by ...
0
votes
1answer
38 views

How to make an object towards the mouse on one Axis - Gamemaker Studio 2

I am trying to have my "obj_playership" move towards the Cursor on a single Axis. Prefer it to be the Vertical Axis. I tried doing this is an "Execute Code Box" in a step event "direction = mouse_x" "...
1
vote
3answers
100 views

How to accurately capture the direction in which the mouse moves?

I used to play this game on Kongregate called Death vs Monstars. A tl;dp (too long; didn't play) explanation of the mechanics is that the character you control follows your mouse cursor. Your ...
0
votes
0answers
73 views

Why is Unity MouseLook very shaky and jittery?

I'm working on a first person shooter game. My problem is that my Mouselook script is shaky and jittery when I looking around. Here is my code: ...
0
votes
1answer
147 views

Unity SceneView Positionning object with mouse position in Editor script

I would like to create an editor tool who can change the position of an object in the scene view into other object in the world, based on mouse position, like in the picture bellow (the red pyramid is ...
0
votes
1answer
72 views

Ideal 3D platformer controls for Keyboard + Mouse [closed]

I am developing a 3D platformer, and I know that controller is optimal for the precise movement, but I don't feel players should have to buy a controller just to experience a 3D platformer that is ...
0
votes
0answers
30 views

SDL_WarpMouseGlobal does not work in game

I tried to use SDL to move mouse in game. The function works fine only in menu, when I join a game, the function does not work. I checked coordinates with ...
0
votes
0answers
196 views

How to drag an object with mouse with collision?

I want to drag a GameObject with the mouse but I need collision. The basic mouse dragging code simply sets the position of the object to the hit.point with an ...
0
votes
1answer
21 views

Transfer mouse movements to a GameObject in 3D according to camera position and rotation

I'd like the game object to follow the mouse but I have trouble doing this when the object is in 3D and the camera has been rotated. The only thing that seems to be true (and still it works only when ...
0
votes
0answers
88 views

ImGui: disable window move with drag event on image

I'm displaying an image with ImGUI like this: ...
0
votes
2answers
69 views

How to panning camera on XZ axis with different angles

I have an Orthographic camera where the position is { x:0, y:100, z:0 } and is pointing/looking at { x:0, y:0, z:0 }. At this ...
0
votes
1answer
88 views

Drag object with mouse in diagonal direction

I have a gameobject which i want to move using mouse. Currently i can do that in x-axis and y-axis: ...
0
votes
1answer
200 views

Move camera while dragging with mouse

I'm currently trying to implement a move-to-drag behaviour in a 2d grid based game. I want to update the camera such that if follows the "head" of the trail being drawn - In this case, the nodes it is ...
1
vote
1answer
177 views

Drawing many separate lines using mouse OpenGL(GLFW/glad)

So, in order to draw a line, I track the coordinates of the mouse, then I add them to the array and capture it as GL_LINE_STRIP_ADJACENCY. However, for example, I completed drawing a line1 at P1 and ...
1
vote
1answer
121 views

What is the difference between a hotkey and a shortcut-key in a game?

I was wondering: What is the exact difference (if there is any) between a hotkey and a shortcut-key in a game? Some games for example allow the player to bind certain actions to a specific key and ...
0
votes
2answers
100 views

How can I make the cursor avoid something completely?

I wrote some code for a UI button that causes the mouse to avoid it. I realize this is kind of a weird thing to do in a game design-wise, but this is a really weird game. I need a button that is not ...
1
vote
1answer
87 views

How do I calculate a new position from current and target position for intuitive non-instant dragging?

I have a simple 2D game where I can move an object using the mouse. I've been improving on the 'feel' of the movement gradually, however it still doesn't behave as you'd expect if the object were to ...
0
votes
1answer
503 views

unity 3d mouselook script help, weird issue

I'm coming back to Unity after a year or two of busy college and I'm having to relearn everything I've forgotten. One thing I cant seem to get right is this basic mouselook script I wrote. Here is the ...
0
votes
1answer
170 views

Rotating Weapon Towards mouse.position

OK guys i have tried lots of things and researched but cannot find a solution please someone give me hope.. So on my phone when i am playing i want to shoot with a screen button in the canvas that is ...
0
votes
1answer
271 views

How to know if mouse coordinates is delta or absolute on Window and Android in Unity?

I wrote sample application, that allows to "rotate" object by mouse. Rotation occured by rotating of camera object around central object and the code is following: ...
0
votes
1answer
62 views

Detect if mouse do multiple circle rotation around a XY point

would anyone know a method or algorithm (js) to calculate and detect if a mouse is moving by a circle around a target? Example if a rotate mouse *4 time around a specific XY point, i would like to re-...
-1
votes
1answer
60 views

Having trouble making more than 1 clickable object

I am a student trying to figure out how to make multiple clickable objects in pygame. I was able to make 1 working clickable object (dx,dy) work, but when I tried to make another clickable object (qx,...
1
vote
2answers
109 views

How do I convert OnCollisionEnter2D to OnMouseDown?

I created a simple animation. I have a "Gamer" object, which I move and hit squares to destroy them. Squares I have to destroy in the right order ...
0
votes
1answer
99 views

Why does the object not move correctly when I press the right mouse button?

2D Game in UNITY C# I have an object BULLET . After pressing the left mouse on my object (BULLET), the script allows me to rotate object according to the mouse's direction, in four directions : -...
0
votes
2answers
56 views

How to keep clicks from menu from interfering with game state?

I ran into a problem coding my game in which when I click the play button on the newly implemented menu, it also creates a bullet from my player. The player and the menu both rely on the mouse input. ...
1
vote
1answer
39 views

Mouse position not updating while mouse buttons are pressed

I have a simple mouse manager class: https://imgur.com/MuUhh73 Whenever any of the mouse buttons are pressed the mouse position does not update when calling ...
-2
votes
1answer
23 views

Help me understand the numbering of buttons in GetMouseButtonDown

I'd like to know what the "0" stands for in this code: if (Input.GetMouseButtonDown (0)) // Do something here
0
votes
1answer
360 views

Trying to get an object to move in the mouse direction XNA C#

Right, so in my Player class where I call the object I got an if statement which gets the coordinates for the mouse ...
0
votes
1answer
212 views

How can I attract & repel the mouse cursor from particular UI controls?

This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far. In particular, my answer below doesn't behave as well as I'...
0
votes
1answer
240 views

2D Screen Coordinates to 2D World Coordinates in LWJGL

I'm making a 2d top down game with lwjgl and am having trouble converting my 2d screen coordinates to 2d world coordinates. Here's what I have so far ...
1
vote
0answers
284 views

Is there a way to get mouse coordinates relative to an sfml window without locking the mouse to the window border or monitor edges?

As the title states, is there a way to get the relative mouse coordinates to the sf::RenderWindow without locking the mouse cursor inside of the window border or monitor edges? In glfw using a mouse ...
1
vote
1answer
322 views

SDL2 dragging a sprite with mouse

I am trying to figure out how to drag a sprite. I know when the mouse is being hovered, pressed, or released over a sprite. I don't know how to tell if the mouse is being pressed and moved at the same ...
1
vote
1answer
201 views

How can I process extra mouse buttons using Monogame?

I use Monogame for game development. For processing mouse input, I can use the Mouse class to query basic information like left click state, right click state, and ...
3
votes
1answer
141 views

Compare mouse movement to the pattern

There are some games where you need to make special movement with your mouse (spell casting or any other action). Something like this So basically, how can I compare mouse movement to my pattern (...
0
votes
0answers
51 views

How to abstract mouse movement event streams for networked multiplayer?

I'm building a mouse driven 3rd person shooter with client-server network architecture. My input system is event based. Keyboard input is captured by keys.S.onUp() ...
1
vote
1answer
113 views

How can I calculate respective 2D world/mouse position through different resolutions?

I have been at this game of trial-and-error for days now. I cannot find a consistent method to calculate the respective mouse position in my game world after the calculations are done to stretch the ...
2
votes
1answer
300 views

How does mouse input work in 3d games? [closed]

How does a game process cursor movements? I know it calculates offset from the middle of the screen, but how? What constraints is that cursor having? Is it locked to the middle of the screen/a ...
4
votes
1answer
70 views

How can I use more than one mouse connected to the same computer as different input devices in Unity?

How can I use more than one mouse connected to the same computer as different input devices in Unity? I want to read the input axis of each mouse individually for local multiplayer games.
11
votes
2answers
3k views

How to make a delayed mouse input?

I have a car game and the idea is that the player is drunk. I want to have a delayed input from the mouse, where you move the mouse side to side to turn. How can I setup a constant delay between the ...