#Jump from a wall

1 messages · Page 1 of 1 (latest)

nocturne sky
#

Does someone know what is wrong in my script, especially in the last line ?

#

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

minor dock
nocturne sky
#

Ho olay, i'll test, thanks

nocturne sky
minor dock
#

try it and then let me know if it works

nocturne sky
#

Ho okay sorry i didnt see 😅

minor dock
nocturne sky
#

the player get tp back but it's not very smooth

#

but thanks

minor dock
#

so you wanna see it smooth?

nocturne sky
#

Yea for make it look like a wall jump, if it's possible

minor dock
#

yeah it's possible let me try something on my engine real queeck

nocturne sky
#

okay, take your time dw and thanks to help me ^^

minor dock
#

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

minor dock
#

I maked better the code now if you need it just let me know

nocturne sky
#

ho okay thanks a lot I will test, thanks ^^

#

I can't test for the moment but i'll check that ^^ thanks again

minor dock
nocturne sky
#

Yeah no problem

nocturne sky
#

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 ?

minor dock
#

You can call it however you want,it’s a timer

nocturne sky
#

Ho okay but what does the function do ? Can you show me your func

minor dock
#

i don't remember but i think i used timer as a limitation for your jump

minor dock
#

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

nocturne sky
#

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

minor dock