Ignore physics/gravity?

Hi all!
I have 2 questions:
I have a Dash function in the game that allows my player to dash forward.
When he dash over a pitfall gravity pulls him into to the pit.
Is there any way to ignore gravity while dashing?

Dash Code:

 if (isDashing)
        {
            if (transform.eulerAngles.y == 0)
            {
                _moveDirection.x += dashDistance;
                _moveDirection.y = 0f;
                //transform.position = new Vector3(transform.position.x, fixedYPosition, transform.position.z);
            }
            else if (transform.eulerAngles.y == 180)
            {
                _moveDirection.x -= dashDistance;
                //transform.position = new Vector3(transform.position.x, fixedYPosition, transform.position.z);
                _moveDirection.y = 0f;
            }

If I change 0f; to 3.5 ish he will move slightly upwards while dashing over a pitfall…

Same goes with Punch in air - When I punch in air he keeps falling down.
Is it possible to set Gravity to “0” or turn of physics… Something like that?

Yes, there’s the setting for gravity right there on the rigidbody 2d?
Set gravity scale to 0 temporarily.

Ah, i see! that simple ^^
THanks!

Ah, EDIT: My rigid body is kinetic… Bút I have gravity in the script I guess. Will try to reach it from there.

EDIT 2: I just set gravity to 0.f inside the script and after corutine timer run out the gravity go back up to 16f; :slight_smile: Thansk!