Skip to main content
36 votes
Accepted

Should I develop with mouse in mind if I plan on targetting more than PC?

Yes, when you want your game to run on PC, you should think from an early design stage on how to best utilize the mouse. The same applies to the input features of all other platforms you consider ...
Philipp's user avatar
  • 123k
27 votes

Ways to draw tracks on 4-connected grid

This is Matt, the creator of Trainyard. @DMGregory summoned me here! :) It sounds like you're working through the same issues I had to deal with. It's a tricky problem where there isn't necessarily a ...
Matt Rix's user avatar
  • 371
12 votes

Simple message box in gdscript / godot

You can use the OS / platform's alert system: OS.alert('This is your message', 'Message Title') You can use ...
hola's user avatar
  • 351
12 votes
Accepted

When translating controls into German, do I assume a German keyboard?

Some advice for the developers you are working with: Game SDKs usually have a method to access keys in a "keyboard layout agnostic" way. For example, the Unity documentation writes: The ...
Heinzi's user avatar
  • 236
6 votes

Should I develop with mouse in mind if I plan on targetting more than PC?

Yes you should. PC users expect that they'll have a mouse to play your game. If you don't use it, your game risks to be labeled as a "poor mobile port", specially if some actions in the game should ...
Vaillancourt's user avatar
  • 16.4k
6 votes
Accepted

Comparing analog stick movements to predefined flick shapes

It looks like all these gestures only care about which points you hit around the outside of the stick's range, and the order you hit them in, so we can take a very simplified approach. Let's label ...
DMGregory's user avatar
  • 140k
6 votes

Ways to draw tracks on 4-connected grid

I think you can solve the two pain points you indicated with a few heuristics. One is a little hysteresis: once the player is drawing in a particular row/column, keep their drawing cursor locked in ...
DMGregory's user avatar
  • 140k
6 votes

How to map gamepad inputs for my platformer?

Most importantly: plan for remappable controls from the start. Different games use different conventions, and different players have different preferences. This is also important for accessibility - ...
DMGregory's user avatar
  • 140k
6 votes
Accepted

Visual Studio not recognizing Unity's new Input system

I found the answer online! I had to go to the editor preferences (Edit -> Preferences) and under External Tools, there's a section with checkboxes under "Generate .csproj files for:." ...
Millard's user avatar
  • 510
5 votes

Is it acceptable to use Hash Maps for input, copying one hash map to an another during the game loop?

Hashmaps are okay. If you believe you are going to get a performance bottleneck on input, then you are doing something critically wrong, or you're pre-maturely optimizing. Unlike the other answer, ...
Water's user avatar
  • 343
5 votes

Should I develop with mouse in mind if I plan on targetting more than PC?

It depends, as usual. What genre? How much money/time do you have? Do you develop the application to make money? Users are generally surprisingly forgiving about bad input controls in niche games (e....
Peter's user avatar
  • 9,955
5 votes
Accepted

What verb describes when you hold a joystick to the right or left?

It isn't probably universal, but, as Ferreira said, it is probably Tilt. A good bit of Xbox 360 games refer to the action you are describing as "titling the joystick to the [direction]".
The Mattbat999's user avatar
5 votes
Accepted

SDL2 mouse motion event keeps occurring

You're not checking the return value of SDL_PollEvent to see if there's a new event, which means that regardless of whether there is an event to handle, you're ...
wizzwizz4's user avatar
  • 165
5 votes
Accepted

Inputs in realtime multiplayer game

It sounds like your problem arises from processing players' input eagerly, the moment it comes in. In this situation, it's harder to keep track of the context of the input and its timing/frequency ...
DMGregory's user avatar
  • 140k
5 votes

How does one detect a button release with Unity's new input system?

OK, here's what I've figured out. The type of the action needs to be Value, not Button or Pass Through—this can be changed in the editor by selecting the action from the list; there's a drop down ...
Michael Macha's user avatar
5 votes

Triggering Enhanced Input Actions via inputs with modifier keys (Shift/Alt/Ctrl) in UE5

After doing some more research and implementing a solution that does work for me, I feel confident to be able to answer my own question. Unfortunately, the answer is: It's as cumbersome as already ...
Simon Fischer's user avatar
5 votes

Cannot read value of type 'Vector2' from WASD KeyControl

The error message is telling you that you're trying to read a Vector2 value from a keyboard key that is currently treated as a Button input. A Button input doesn't have a Vector2 value; a Button is ...
Kevin's user avatar
  • 6,859
4 votes

How to detect when the mouse is over a particular enemy collider, without falsely selecting bullet colliders?

First, configure your Layers so that you have a layer for bullets and a layer for enemies. Ensure you've set the bullet prefabs to use the bullet layer, and the enemies/enemy prefabs to use the ...
DMGregory's user avatar
  • 140k
4 votes
Accepted

Can less than 30 FPS feel good with 60 FPS input handling?

Yes. But it depends on what you do with that input, the player, and the game design as a whole. How a game "feels" is all about feedback. I beleive this to be a consequence of the user ...
Romen's user avatar
  • 416
4 votes
Accepted

Input reaction is slow in two player snake game

I think i call getKEYS2() but program tries to run getKEYS1() too and that's why reaction is slow. Am i wrong? You are wrong. C++ does not randomly call a completely different function with a similar ...
DMGregory's user avatar
  • 140k
4 votes

Caret not visible with TMP_InputField created from script

Found the answer burried several pages deep in google search pointing to the unity forum. Basically, one has to re-enable the component because the canvas is created via ...
akarnokd's user avatar
  • 233
4 votes
Accepted

Detect if a key other than "this" key has been pressed

You can first check whether "any" key has been pressed, then check if the key you're listening to has not, to respond only to presses that were not that key. ...
LudoProf's user avatar
  • 751
4 votes

When translating controls into German, do I assume a German keyboard?

You don't assume a German keyboard. You ask the operating system what keys there are on the keyboard and where they are. And you check what other apps are doing. Games will often use four keys in some ...
gnasher729's user avatar
3 votes

Is it acceptable to use Hash Maps for input, copying one hash map to an another during the game loop?

Copying hash maps is horribly expensive, in the context of an operation that needs to be executed millions of times a second. You're doing this up to 120 times a second. Performance-wise it's ...
Peter's user avatar
  • 9,955
3 votes
Accepted

How to activate Xbox controller vibrations in Unity?

Yes, you're right: The Handheld class just covers handheld devices but not controllers. There is a library called XInput which should cover your needs. You'll find it on GitHub: https://github.com/...
Morph's user avatar
  • 102
3 votes
Accepted

Unity Deactivating Keyboard Input Interpolation

You can use the built-in method Input.GetAxisRaw From the docs: Returns the value of the virtual axis identified by axisName with no smoothing filtering applied. The value will be in the ...
qCring's user avatar
  • 620
3 votes
Accepted

Keyboard input conflict in wall jump

Your actual way of handling this is a frame perfect, this mean that to actually go to the C state you have to press both right and jump at the same frame (which very hard). A solution could be to ...
Shashimee's user avatar
  • 1,290
3 votes

Is it acceptable to use Hash Maps for input, copying one hash map to an another during the game loop?

It seems like you will know what types of inputs there will be ahead of time, so using a HashMap seems over-complicated to me. You want to pass around a bunch of ...
Ryan1729's user avatar
  • 724

Only top scored, non community-wiki answers of a minimum length are eligible