- Home /
Pressing multiple buttons in a single swipe [MOVEMENT]
Basically I'm doing a fighting game for mobile, and I need a fluid arrow key movement, I have the movement, but my problem is that to change direction I have to lift my finger from the screen and press another arrow key and I want that without having to lift your finger you can press in all four directions.
I have made a video of my issue: (I kept holding left click in video)
https://gyazo.com/9c2eb5acb43d20b39788e9ad98b3dc64
I'm actually using StandartAssets touch arrow keys
using UnityStandardAssets.CrossPlatformInput;
public class PlayerMovement : MonoBehaviour
{
private void FixedUpdate()
{
horizontalMove = CrossPlatformInputManager.GetAxisRaw("Horizontal") * runSpeed;
}
}
Hi edit your question and add your code so that suggestions can be made
This probably won't be useful to you but you can't really test this on windows since as long as you don't release mouse1 (I assume you kept holding it during the video), nothing will happen.
Answer by SaZCoR · May 13, 2020 at 10:47 PM
I did it! After some investigation on the scripting api, I found that I could use Event Triggers to detect if the mouse (finger in my mobile game) is touching my button, just modified a bit "AxisTouchButton" script from Unity StandartAssets, here's the image on the movement arrows
Answer by wah2068 · May 14, 2020 at 01:32 PM
Hi SaZCoR,
I'm trying to do something like what you have asked but I'm not getting any replies on here and even had 1 of my questions rejected by 1 group. This is what I asked, I'm trying to do a multiple mouse click button, I want to click on a blank 2d dice so then it will be a dice 1 face, then click on it again and it will be dice 2 face and so on to dice 6 face. I've got it to click from blank to 1 but that's it. This is what I've got so far.
I'm not sure if there is something I have to do with the (On Click) option but I don't know what script to write if any? Any help or tips will be most appreciated. Thank You. That was my question and I was wondering if you had any ideas seen as you worked out something a bit like the problem I'm having at the moment. Anyway, I hope you don't mind me contacting you like this but I'm not getting any response from anyone on Unity. Thank you for your time.
Your answer
Follow this Question
Related Questions
Touch MovementSpeed for Android/iOS 0 Answers
store the user touch input 0 Answers
Control key + A/D not working 3 Answers
How to remove blur when moving 2D objects 1 Answer
StackOverflow error 1 Answer