Gravity against addforce control

I am developing an android game and I am using this code for the character to go above along y axis when i touch my phone.

var thrust=0;
var leftMoveIntensity =-0.05;
var rightMoveIntensity =0;
function Update() {
    var rb=GetComponent.<Rigidbody>();
    //spin the sphere all the time
//this.transform.Rotate(0,rotateSpeed*Time.deltaTime,0);
    if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved) {
        // Get movement of the finger since last frame
        var touchDeltaPosition = Input.GetTouch(0).deltaPosition;
        // Move object across XY plane
        rb.AddForce(0,0.05 * thrust,0);
    }
   
    if(Input.GetKey("a"))
    {
        transform.Translate(leftMoveIntensity*Time.deltaTime,0,0);
    }
    if(Input.GetKey("d"))
    {
        transform.Translate(rightMoveIntensity*Time.deltaTime,0,0);
    }
    if (Input.GetKey("s"))
    {
        rb.AddForce(0,-0.05*thrust,0);
    }
   
}

This is working great only if I turn off gravity for the ball. As soon as I launch the game, gravity becomes superior than touch and my character falls down. However if I turn off gravity and then touch it works properly.

Can someone suggest me whats is wrong?

Thanks a lot for your time.

I dont knonw if I can understand correctly what is your problem, but it seems working properly to me.
Well, you can to try change your “translate” to add force and see if it work. Maybe translate and addForce don’t work well together.

Edit: Gravity is around 9.8 per frame… so try this:

rb.AddForce(0,0.05 * thrust,0, ForceMode.Impulse )

Thanks for your reply but Foremode.Impulse is making the character go up super fast. I tried regulating the speed of ForeceMode.Impulse by multiplying it with Time.deltaTime and a new variable but it wont support this it seems.

You can try some forcemode from here: