Jumping and wall stick mechanic not working like before

I’m on version 4.2.2

So like a lot of platformers i have a jump which works fine on keyboard and used to work fine on controller but for some reason doesn’t anymore on controller and i don’t know why, all my inputs are mapped correctly and everything

And i have this mechanic where if my character is dashing and enters a specific area (using On_body_entered) that the gravity would set to 0 making it act like the character was stuck to the wall which also used to work fine but now dosn’t work for mouse or controller any ideas???

Here’s my code!

extends RigidBody3D
class_name Player
#```
var respawn_position := global_position

var mouse_sensitivity := 0.001
var controller_sensitivity := 0.070
#var twist_input := 0.0
#var pitch_input := 0.0
var DASH_SPEED := 1000
var can_dash: bool = false
var walkingspeed= 1200
var crouchspeed = 600
var jumped = false
var doublejump = false

var currentspeed = walkingspeed

var isCrouching = false
var isNeutral = true
var isdashing = false
var groundpounding = false
var onground = false
var wallstick = false


@onready var character := $Character
@onready var twist_pivot := $TwistPivot
@onready var pitch_pivot := $TwistPivot/PitchPivot
@onready var timer = $dropTimer

func _ready() -> void:
	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
	
	
func _process(delta: float) -> void:
	var input := Vector3.ZERO
	if groundpounding == false:
		if wallstick == false:
			input.x = Input.get_axis("move_right", "move_left")
			input.z = Input.get_axis("move_back", "move_forward")
			apply_central_force(twist_pivot.basis * input * currentspeed * delta)
			#$Character/AnimationPlayer.play("Run")
		
		var twist_pitch : Vector2 = -Input.get_vector("look_left", "look_right", "look_down", "look_up") * controller_sensitivity
		apply_camera_input(twist_pitch.x, twist_pitch.y)
		
	
	if $RayCast3D.is_colliding():
		if isCrouching == false:
			if wallstick == false:
				if isdashing == false:
					onground = true
					can_dash = true
	
	if Input.is_action_just_pressed("dash") and can_dash:
		if $RayCast3D.is_colliding():
			apply_central_impulse(Vector3.UP * 2.0)
			onground = true
			can_dash = false
			apply_central_impulse(twist_pivot.basis * input * DASH_SPEED * delta)
			timer.start()
			self.gravity_scale = 0
			isdashing = true
			$Character/AnimationPlayer.play("Dash")
			
		else:
			onground = true
			can_dash = false
			apply_central_impulse(twist_pivot.basis * input * DASH_SPEED * delta)
			timer.start()
			self.gravity_scale = 0
			isdashing = true
			$Character/AnimationPlayer.play("Dash")
		
	if Input.is_action_pressed("crouch"):
		if $RayCast3D.is_colliding() == false:
			if jumped == true:
				if isCrouching == false:
					$Character/AnimationPlayer.play("Ground Pound")
					apply_central_impulse(Vector3.DOWN * 3.0)
					groundpounding = true

		elif $RayCast3D.is_colliding():
			if isCrouching == false:
				movementStateChange("crouch")
				currentspeed = crouchspeed

		
	elif not Input.is_action_pressed("crouch") and $"Crouch Raycast".is_colliding() == false:
		if isCrouching == true:
			movementStateChange("uncrouch")
			currentspeed = walkingspeed


	if Input.is_action_just_pressed("ui_cancel"):
		Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
		
	
	if not input.is_zero_approx():
		var move_direction = twist_pivot.basis * input
		var align = character.transform.looking_at(character.transform.origin - move_direction)
		character.transform = character.transform.interpolate_with(align, delta * 20.0)

func _on_drop_timer_timeout():
	if wallstick == true:
		pass
	else:
		self.gravity_scale = 3.5
		isdashing = false


func _unhandled_input(event: InputEvent) -> void: 
	if event is InputEventMouseMotion:
		
		if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
			var twist: float = - event.relative.x * mouse_sensitivity
			var pitch: float = event.relative.y * mouse_sensitivity
			apply_camera_input(twist, pitch)
	
	

func apply_camera_input(twist_input: float, pitch_input: float) -> void:
	twist_pivot.rotate_y(twist_input)
	pitch_pivot.rotate_x(pitch_input)
	pitch_pivot.rotation.x = clamp(pitch_pivot.rotation.x, 
	deg_to_rad(-20), 
	deg_to_rad(20)
	)



func _unhandled_key_input(event):

	if event.is_action_pressed("jump"):
		if $RayCast3D.is_colliding() or wallstick == true:
			apply_central_impulse(Vector3.UP * 16.0)
			self.gravity_scale = 3.5
			can_dash = true
			jumped = true
			wallstick = false
			if isCrouching == false:
				$Character/AnimationPlayer.play("Jump")
				
		elif jumped == true:
			if isCrouching == false:
				if doublejump == false:
					$Character/AnimationPlayer.play("Double Jump")
					apply_central_impulse(Vector3.UP * 16.0)
					self.gravity_scale = 3.5
					doublejump = true
					
	if $RayCast3D.is_colliding() or wallstick:
		doublejump = false
		groundpounding = false
					
					
		if $RayCast3D.is_colliding():
			groundpounding = false

func movementStateChange(changeType):
	match changeType:
		"crouch":
			if isNeutral:
				$Character/AnimationPlayer.play("Crouch")
			isCrouching = true
			isNeutral = false
			changeCollisionShapeTo("crouching")
			
		"uncrouch":
			$Character/AnimationPlayer.play_backwards("Crouch")
			isCrouching = false
			isNeutral = true
			changeCollisionShapeTo("standing")


func changeCollisionShapeTo(shape):
	match shape:
		"crouching":
			#false is enabled josh
			$crouchCollisionShape3D.disabled = false
			$standingCollisionShape3D.disabled = true
		
		"standing":
			$crouchCollisionShape3D.disabled = true
			$standingCollisionShape3D.disabled = false


func _on_wall_stick_zone_body_entered(body):
	if body is Player:
		if isdashing == true:
			wallstick = true
			$Character/AnimationPlayer.play("Wall Stick")
			self.gravity_scale = 0
			jumped = false