Trouble with bowling game mechanics.

I’m working on a simple bowling game where you are able to adjust the x position and y rotation of the ball before shooting.
I’m trying to make it so you first adjust the x position of the ball with the “A” and “D” keys. Pressing the space key would then change the operation of the “A” and “D” keys to adjust the y rotation. Pressing the space key one more time will fire the ball.
My script behaves very randomly. Sometimes it performs as expected, sometimes the ball will fire on the first space key press, and sometimes it takes many key presses to make the ball fire. Any insight would be appreciated.

using UnityEngine;
using System.Collections;

public class SphereControllerV2 : MonoBehaviour {

   bool isReadyToFire = false;
   public float rotationSpeed;
   public float forwardSpeed;
   private Rigidbody rb;

    // Use this for initialization
    void Start () {
        rb = GetComponent<Rigidbody>();
	}
	
	// Update is called once per frame
	void FixedUpdate () {

        if (isReadyToFire == false)
        {
            sidewaysMovement();
        }

        if (isReadyToFire == true)
        {            
            rotationMovement();
        }
	
	}

    void sidewaysMovement()
    {

        if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(Vector3.left * Time.deltaTime);
        }

        if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(Vector3.right * Time.deltaTime);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            isReadyToFire = true;
        }
    }

    void rotationMovement()
    {
        if (Input.GetKey(KeyCode.A))
        {
            transform.Rotate(Vector3.down * Time.deltaTime * rotationSpeed);
        }

        if (Input.GetKey(KeyCode.D))
        {
            transform.Rotate(Vector3.up * Time.deltaTime * rotationSpeed);
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            rb.AddForce(transform.forward * forwardSpeed);
        }
    }

   
}

The problem is you’re trying to detect key presses in FixedUpdate() instead of Update(). GetKeyDown() is only true on the one game frame where the key is first registered as down. Update() is run for every frame, where FixedUpdate() runs at a fixed rate of 50fps to match with the physics engine.

If your game is running at a higher framerate, then the keypress could register in between FixedUpdates. If your game is running slower or has a dip in framerate, then FixedUpdate could run twice for an Update and a keypress can be seen twice.

Since most of the code does not affect physics, it can be moved to Update. For the actual launching of the ball, since it is physics, I’d suggest setting a bool on the second spacebar press, and react to it in FixedUpdate().