UNITY(3D) CONTROL TROUBLES

Discussion in 'Indie Basics' started by MercyonX, Jun 30, 2020.

  1. MercyonX

    MercyonX New Member

    Joined:
    Jun 30, 2020
    Messages:
    1
    Likes Received:
    0
    Hello,
    So a friend and I are developing a game together. its a pong game with some depth. The player has more control over the ball. The player can tilt the paddle into two different angles, charge to hit the ball with more power, and a risk and reward mechanic.
    While programming the controls, I ran into a issue. The player is suppose to be able to hold the charge the paddle while being able to change the angles and move up and down.
    \The Problem:
    when the player pushes down the angle button along with the charge button, the program refuses to recognize the buttons that move the player.
    the angle button is mapped to the "A" key
    once i changed the angle button to a different key, the player was able to charge the paddle, move up and down, and change the angle
    The problem only occurs when I map anything to the "A" key.
    is anyone knowledgeable about unity to figure out why the "A" key forces the program to recognize two keys?
    I used else-ifs to program the controls, im not sure if that's the problem but the code is below

    Code:
    void Rotate()
        {
    
            if (InputManager.LPaddle_Stick())
            {
                   ResetNetrual();
                NeturalPos.SetActive(false);
                StickPos.SetActive(true);
                isRotateKeyDown = true;
            }
          
            else if (InputManager.LPaddle_Angle_1())
            {
              
                ResetNetrual();
                NeturalPos.SetActive(false);
                DianolUp.SetActive(true);
                isRotateKeyDown = true;
            }
    
            else if (InputManager.LPaddle_Angle_2())
            {
                
                ResetNetrual();
                NeturalPos.SetActive(false);
                UpwardPos.SetActive(true);
                isRotateKeyDown = true;
    
            }
    
            
    
    
            else if (isRotateKeyDown == true)
            {
                ResetNetrual();
                isRotateKeyDown = false;
            }
        }
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer