Having the whole script is fine, what I meant is just having more context on what did you try and what was the result.
From what I see in your opposite()
method, you set velocity.x
which I assume is used in a move_and_slide()
method somewhere else in the code. Where do you change velocity.x
in your script other than here ? Depending on how you change this value your wall jump might not work.