could i get some help with optimization for my code
func wall_run():
if Input.is_action_pressed("jump"):
if Input.is_action_pressed("Forward"):
if is_on_wall():
yield(get_tree().create_timer(0.2),"timeout")
wall_normal = get_slide_collision(0)
velocity.y = y_velocity
y_velocity = -0
if not wall_normal == null:
direction = -wall_normal.normal *speed
else:
wall_normal = Vector3.UP
whenever I turn away from the wall to much it lags massivley and i get this error
_get_slide_collision: Index p_bounce = 0 is out of bounds (colliders.size() = 0)