#Jump from a wall
1 messages · Page 1 of 1 (latest)
the last line doesn't work and i dont know why, I want to like move to the right and then add a line for the jump to simulate a wall jump
I don’t know too much about this because I started to make games less than 1 month ago but I think I had a problem like that one time,the velocity is being altered but I think you need to change velocity by the position
Can you try if that works?
Ho olay, i'll test, thanks
Do you already have an idea of how i can do that ?
maybe if you just change the word velocity by the word position 😅 i think i said it in the message
try it and then let me know if it works
Ho okay sorry i didnt see 😅
don't worry just try it and then tell me how is it?
so you wanna see it smooth?
Yea for make it look like a wall jump, if it's possible
yeah it's possible let me try something on my engine real queeck
okay, take your time dw and thanks to help me ^^
well technicly i find someway to make it possible
but you need to adapt it to yourproyect
okey you know the process function?
you can smooth the movement using each frame
it's something really basic what i did but if you change some values it can help you:
first i declared a variable:
var jumping_from_wall = false
and then i maked this logic if your character is colliding with a wall and is not in the floor you can press a bottom and able the variable that was false before
if is_on_wall() and not is_on_floor(): if Input.is_action_just_pressed("ui_down"): print(str("Position before:")+ str(position.x)) jumping_from_wall = true time_deplazing.start() print(str("Position now:")+ str(position.x)) elif is_on_floor(): jumping_from_wall = false
if that variable is equal true:
if jumping_from_wall == true and not is_on_floor(): position.x -= 1
you can change position.x -= 1 depending of what you need (and also add delta)
The fun of programming is that you need to be creative
does that works to you?
also if you want to make the player go up when he jumps from a wall you can do it doing something simillary to what i did with position.x but with position.y
I maked better the code now if you need it just let me know
ho okay thanks a lot I will test, thanks ^^
I can't test for the moment but i'll check that ^^ thanks again
don't worry take your time and don't forget to let me know if it worked for you
Yeah no problem
Hi, so I tested your script and I have a problem, I don't know if the movement work but the function time_deplazing.start() is not declared, so it is from your script or do I need to add a special node ?
It’s from my script
You can call it however you want,it’s a timer
Ho okay but what does the function do ? Can you show me your func
function? what function do you mean?
i don't remember but i think i used timer as a limitation for your jump
ohhh i know what you mean
this is a little bit fun but i started the timer but i never maked a function for the timer 🤣
i whink you should do it the timer works as a limitation for how strong are you jumping
so your function does basically nothing ? 😭
Just, can I add you on discord if I have some questions or whatever ? I won't spam you, I promise
Yeah np 👍
Basically yes 😅🤣