#Need help with wall jump
1 messages · Page 1 of 1 (latest)
so you want a is_touching_wall(&wall_direction) sort of function?
not really, i just want a line of code or a tecnic for jump from the wall , like in this video
so more of a if is_touching_wall(&wall_direction): wall_stick(wall_direction), followed by wall_stick(wall_direction) logic to handle input?
yes
well, the is_touching_wall() -> bool return value could be gotten by using RayCast (might be the wrong name I'm not sure, just the ray casting node) nodes for the left and right of the character...
the wall_stick() function could be just an if-else chain for jumping, sticking in mid-air, or dropping downwards when not pushing against the wall; impulse the character in the direction opposite to the wall and upwards on a jump etc....
but the is_on_wall function work, i just need a line for like taking pushback or idk but like if we jump from the wall
idk if it's clear
so is_on_wall has no direction for the wall being collided with?
i don't really know but, in this script, i do it only for left sides walls so if it's just a value or a variable i just need to put it positive or negative
so the direction does not matter, does it ?
it only matters if you want the "push-back" effect which moves the player away from the wall, otherwise you'll not be able to tell which direction to push in except from upwards
oh okay I see
I'm a beginner so excuse me for the fact i'm really bad, but, later in the script there's this line, does it mean the var direction take the value 1 or -1 according to the direction ? direction = Input.get_axis("move_left", "move_right")
it just gives a value in the range [-1,1] based on which of the two given inputs are currently pressed down; the mapping seems pretty strict, but a more generic operation might be `direction = lookup_value("move_right") - lookup_value("move_left")
ho okay, so it can work, can't it ?
"move_left" and "move_right" are for your keyboard inputs for left and right respectively; if you want a super meat boy sort of "kick" off of the wall you'll have to use a different method