Tag Info

New answers tagged

0

The modifier keys can be combined with OR-bits. You need to use AND-bits to test for the modifier flags since it could contain all of CTRL+ALT+SHIFT (Left AND Right) and even some other modifier keys. For example, if NumLock or CapsLock is ON, the value will never be == to LeftShift. See the documentation for the ModifierKeys. It is also not necessary to ...


1

If the movement speed/direction is not multiplied by Time.deltaTime than the movement speed on different computers might be different, so it is always good to do that to ensure the speed is the same on each computer and not depending on the performance of it.


2

There are two options for receiving input, generally. The first - and most common in general applications - is to use the OS event queue. This is PeekMessage/WaitMessage in Win32, or SDL_PollEvent/SDL_WaitEvent in SDL2, and so on. With this model, it doesn't matter how slow your application becomes, as the input will be put into the queue and the app will ...


2

There's a pretty simple explanation to this. When a game is lagging, it means the entire system is under stress, and as such, lagging as well (while in the game at least). So when you hit an input, the OS registers it, and sends it to the game. But if the entire system and thus the OS are lagging and behind, the input will be queued up, and then once ...


2

If you wish to change the position of your object at a set location, you can simply change the local position of your transform as such: GameObject.transform.localPosition = new Vector3(0.0f, y, 0.0f); Note: you need to increment the y value every time the up key is pressed. If you are attempting to see the movement of the object from Vector3(0.0f, ...


3

because Translate is set to Space.Self if the Second Argument is left i would try this code below to force it to World Space transform.Translate(Vector3.up * Time.deltaTime, Space.World);


2

At a guess and according to http://docs.unity3d.com/ScriptReference/Transform.Translate.html your problem might be the following: If relativeTo is left out or set to Space.Self the movement is applied relative to the transform's local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the ...


1

If I am understanding the question correctly, you just want the delta mouse when you are in relative mode. According to the docs, https://directxtk.codeplex.com/wikipage?title=Mouse&referringTitle=Home#Absolute%20vs.%20Relative%20Mouse%20position When you query the state of the mouse, the x and y coordinates return the delta. Note, because you ...


1

If you have to handle a large set of keys have a look at: SDL_GetKeyState which gives you a snapshot of the state of the whole keyboard.


0

3.5mm support would probably be easier if you want something to work out of the box by default. Android is a very mature platform at this point and it has plenty of other applications besides just a Phone operating system. The OS has a fairly well documented USB api: https://developer.android.com/guide/topics/connectivity/usb/index.html which can probably ...


2

Based on my memories and for example this: While it's difficult to understand the complicated ANDs and ORs, it seems clear that you forgot to check for the jumpButton being pressed after the other buttons. With leftButton and rightButton, you have Gdx.input.isTouched(0) as well as Gdx.input.isTouched(1) (with OR inbetween them, so I take that as you're ...



Top 50 recent answers are included