In a 2d based game using c# how do i create a zone where upon entering my player will be swooped upwards?? hence playing on gravity on the y axis.

0
So far i created a trigger field, but upon entering it the only thing that happens is , my player can keep jumping indefinitely as long as he is in that zone… i basically recreated flappy birds :stuck_out_tongue: here is my code : public GameObject q; void Start () {

}
public void OnTriggerStay2D(Collider2D col) {

 if (col.gameObject.tag == "trig1") 
 {
     //q.rigidbody2D.AddForce(new Vector2(1100,110));
     //q.rigidbody2D.gravityScale
     Debug.Log("entered");
     //rigidbody2D.gravityScale= new Vector2(0,100);
     col.rigidbody.useGravity=false;
     //    Physics.gravity= new Vector2(-550,-500);

}
void Update () {

}

as you can see i have tried multiple thing but all have given the same effect , in fact removing them has also the same effect… so?? HELP!!! an answer would be greatly appreciated ! Thank you!

Set gravity to a negative number.