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
1
vote
1answer
35 views

The gameloop is stucking the window

I tried to display a player image in a 800x600 window using PyGame but when I try it, the window just gets stuck (immovable with mouse drag, minimize,maximize and close button is stuck and not ...
0
votes
0answers
29 views

How to correct mouse position to world position in xna/monogame

I'm making a small game where the player shoots projectiles by clicking the mouse. Everything worked fine before adding in a camera. Now the position of the new projectiles is always off. shoot code:...
0
votes
0answers
26 views

SDL2 - show a tooltip at the cursor that displays RGB of the pixel under the cursor?

I'm writing an SDL2 program, in which I create a SDL_CreateWindow and get its SDL_GetWindowSurface, then I prepare some pixel ...
0
votes
1answer
71 views

OpenGL convert mouse position to world coordinates without gluUnproject in Python?

EDIT: I changed the bottom left to -1,-1 and the top right to 1,1, and while I can draw objects within this range, I cannot map the mouse x,y to the world space. I have been trying to learn OpenGL and ...
0
votes
1answer
30 views

Stuttery camera with mouse movement

I'm implementing a framerate independent FPS camera and I'm having a problem with jerky camera. The camera is smooth if I translate it or if I make it rotate at a fixed rate, but as soon as I start to ...
0
votes
1answer
34 views

Why won't my block Spaces/Holders hold my blocks when I drag onto them in Unity?

In my game I am trying to have numbered blocks and math operators be able to be dragged down into their respectively color coded holders (white holders = Numbers, black holders = operations). The ...
0
votes
1answer
24 views

SetCursor: Cursor does not contain a definition for "SetCursor' or why can't I re-assign the cursor in Unity 20194.7f? [closed]

Here is the code I used on Cursor script, attached to a chest object. ...
1
vote
1answer
57 views

Best Practices for Locating Clicks

I am building a 2D board game in Unity with a static camera pointed down at the game board. During the active phase of each player's turn, I want to detect where they click on the board. Fortunately, ...
1
vote
1answer
105 views

Godot: How to get mouse button input for a Tilemap for Cellular Automata

Conway's Game of Life I have been working with a tilemap for the implementation of a cellular automata game. My current method for getting mouse button input is using an Area2D as a child of the ...
0
votes
0answers
23 views

How to properly resize canvas according to screen size? (Javascript)

So, as the question says I need to resize the canvas according to screen size. However the thing is that that's not it. I also need to have the mouse coordinates updated proportionally. Seems like I ...
0
votes
0answers
33 views

How to reverse the movement of the mouse on the X and Y axes?

I would like to know, how to do so that when moving the mouse to the right, it would go to the left and vice versa. I looked for something related on the gamemaker page, but I didn't find what I'm ...
0
votes
1answer
20 views

Question about taking mouse input in unity 2D

I'm learning a course on unity and when we started learning about taking mouse input the following code is used. ...
0
votes
0answers
27 views

Java clicking on tiles detection

I am making small isometric game, where I want to do something when user clicks a tile. I can simple do it by mouse location, but I want to be able for zooming and moving camera. It will be 2D game ...
0
votes
1answer
67 views

I accidently changed the cursor image in Unity

In the Unity Editor I accidently changed the image for the mouse cursor in project settings > player How can I restore it to the default, preferably not through programming?
1
vote
2answers
87 views

Rotate object always at same speed on screen, no matter camera distance?

I am rotating a globe like XCOM's hologlobe, I rotate it using Quaternion.RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta). I found a good value for ...
0
votes
1answer
341 views

In Unity, how do I make text/annotations appear when I mouse over GameObjects in playmode?

How do I make text appear when I mouse over GameObjects in-game? What is the Unity jargon for this? I'm assuming it's 'annotations'.
0
votes
0answers
25 views

Mouse detect object without Collider?

Is there any method for mouse or ray to detect object doesn't have collider ? If no, what also can I use ?
0
votes
1answer
61 views

Way to Prevent Stacking Pieces

I have a chessboard with all the black pieces that move with this code: I found that when I move the pieces, they will stack on top of each other. How can I prevent this? I have since changed the ...
0
votes
1answer
264 views

CharacterController rotation with mouse

I'm trying to rotate my characterController around with the mouse movement. I've tried to do so with this: ...
0
votes
1answer
771 views

How to get the actor to follow the mouse while clicking and holding?

I am trying to do the top down project from scratch. I can already get the actor to move toward the mouse click: Only I need to keep clicking several times to change its path and keep walking ...
3
votes
1answer
49 views

Can Event Triggers be used on Non-UI objects?

Is there any way to use UI-Based event triggers on Non-UI objects? Example : on any UI object, you add an EventTrigger component, set the event, and then set the ...
0
votes
1answer
379 views

Unity 2D launch player towards mouse location

few notes: I'm new to game development I'm not new to developing (1 year of front end web development) I'm trying to get my character to launch towards mouse left click button (which I understood to ...
0
votes
2answers
116 views

Extending control remapping script to work with mouse buttons

I have created a default key map for my game, however I have also included an option in the settings where the player can change the key bindings. My issue is if the player clicks on the button for ...
1
vote
1answer
116 views

Clone gameobject on drag without having to click a second time

I have a standard Cube gameObject (with a BoxCollider and my CubeController.cs script) in my scene and I want to be able to click and drag on it to instantiate a new cube prefab (with a BoxCollider ...
0
votes
1answer
157 views

How to make my character walk by clicking and holding the mouse button?

I created an Action Mapping using the right mouse button as a reference. The Action Map is called "Andar" (walk in english). In the character code, I call this Action Mapping and in it I make the ...
0
votes
2answers
1k 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
33 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 ...
0
votes
2answers
439 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
2k 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
118 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
61 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 ...
2
votes
2answers
595 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
73 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
70 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
1answer
124 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" "...
2
votes
3answers
500 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
332 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: ...
1
vote
1answer
1k 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
289 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
466 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
55 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
2answers
104 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
331 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
335 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
369 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
531 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
165 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
155 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
907 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
422 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 ...

1
2 3 4 5