0 votes

Hey,
So I can walk on walls and when I jump again I want to jump off the wall to jump on another wall, for example.
I have already done two methods:
The first method just pushes me straight off the wall, which looks pretty dumb and isn't right either:

if $LeftRayCast.is_colliding():
  normal = $LeftRayCast.get_collision_normal()
  velocity += normal * 5000
  velocity += Vector3.UP * 5000

The second method doesn't really repel me at all but just gives me a speed boost along the wall

if $LeftRayCast.is_colliding():
  var normal = $LeftRayCast.get_collision_normal()
  var bounce = 5
  velocity = (velocity - 2 * velocity.dot(normal) * normal) * bounce

I found a video that shows relatively exactly what I would like to have. Unfortunately there is no code for this. But so you can better imagine what I want.
https://www.youtube.com/watch?v=eNjQzSAAFl8&feature=youtu.be

in Engine by (107 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.