+1 vote

I am making a Fps and when my character starts wall running it seems to want to stick to the wall. when i try to jump off the wall it still sticks to the wall. how do I fix this

Here is the code:
func processwallrun():
if can
wallrun:
if Input.isactionpressed("uiright") and isonwall():
var collision = get
slidecollision(0)
var normal = collision.normal
var wallrun
dir = Vector3.UP.cross(normal)
var playerviewdir = -camera.globaltransform.basis.z
var dot = wallrun
dir.dot(playerviewdir)
if dot < 0:
wallrundir = -wallrundir
wallrundir += -normal * 0.01
is
wallrunning = true
gravity = 10
direction = wallrundir
if Input.is
actionpressed("uileft") and Input.isactionpressed("jump"):
iswallrunning = false
if Input.is
actionpressed("uileft") and isonwall():
var collision = getslidecollision(0)
var normal = collision.normal
var wallrundir = Vector3.UP.cross(normal)
var player
viewdir = -camera.globaltransform.basis.z
var dot = wallrundir.dot(playerviewdir)
if dot < 0:
wallrun
dir = -wallrundir
wallrun
dir += -normal * 0.01
iswallrunning = true
gravity = 10
direction = wallrun
dir
if Input.isactionpressed("uiright") and Input.isactionpressed("jump"):
is
wallrunning = false
gravity = 20

        else:
            is_wallrunning = false
            gravity = 20
Godot version v3.3 stable
in Engine by (23 points)
edited by

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.