Diagonal Wall Jump

Hey everyone!
I want my player jumps automatically and diagonally when I click the spacebar
I’m going crazy to figure out how to do it and as the last option I decided to ask for help here, i hope you can help me T_T
my player has rigidbody so i tried with addforce… i tried with transform.translate too but it’s like i need to press the spacebar without interruption to get the diagonal movement, instead i need that the player does this jump with only a tap…

35183-immagine.png

First, zero out your player’s y velocity when he hits the wall (makes things more accurate):

rigidbody.velocity = new Vector3(rigidbody.velocity.x, 0, rigidbody.velocity.z);

Then apply the wall jump force:

rigidbody.AddForce(Vector3.up * wallJumpForce, ForceMode.VelocityChange);