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?