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
41 views

Way to Prevent Stacking Pieces (DnD)

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
507 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 ...
1
vote
3answers
221 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
1answer
51 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 ...
0
votes
1answer
34 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: ...
2
votes
1answer
38 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
283 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
1answer
613 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 ...
0
votes
2answers
115 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 ...
0
votes
1answer
172 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: ...
3
votes
2answers
121 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
50 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
1answer
164 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
1answer
339 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
2answers
109 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 ...
0
votes
1answer
77 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 ...
1
vote
1answer
44 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
2answers
71 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 ...
1
vote
1answer
56 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
1answer
29 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
230 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
670 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
62 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 ...
0
votes
0answers
47 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 ...
2
votes
1answer
756 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.
0
votes
1answer
41 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
1answer
41 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" "...
0
votes
0answers
39 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
0answers
137 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
122 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
35 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
288 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
24 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
125 views

ImGui: disable window move with drag event on image

I'm displaying an image with ImGUI like this: ...
0
votes
2answers
84 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
261 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
243 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
220 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 ...
1
vote
1answer
30 views

Reversing translational dependency of Sprite on Mouse instantaneously at runtime without causing the sprite to jump

Help me think through a logical way to implement the desired effect. Goal: (I'm using Adobe Animate CC 2017 targeting AIR for Desktop) Move a sprite using a controller (mouse on a PC for instance) ...
1
vote
1answer
106 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
658 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
257 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
votes
1answer
70 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,...
0
votes
1answer
86 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-...
3
votes
2answers
491 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 ...
4
votes
1answer
81 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.
0
votes
1answer
101 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 : -...
1
vote
1answer
230 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 ...
0
votes
2answers
1k views

Touch a specific area on the screen in Unity 5

I am building a Roulette game in Unity 5. I want to place bets on a Roulette table when I touch specific areas on the screen with mouse(PC) and touch(mobile). For example when i touch Number 1 on the ...