Here’s a video of it on twitter. I reposting it here because my internet is slow and it took forever to upload to twitter( despite how short it was):
On the tweet, I said “It keeps accidentally jumping sometimes why I move it up the slope, this is regardless of whether or not code for jumping is present.”
Also further stated “The capsule collision shape is apart of the problem but, changing it wouldn't completely address the issue; a coding the solution is needed.”
I think I spoke about a similar issue, before. However, I hope that the video helps to better illustrate the problem. I really want to find a solution to this problem, so here is to code for the FPS controller movement in it's entirety.
var dir_input:= Input.get_vector("move_left","move_right","move_forward","move_backward")#direction Input
var direction = (self.transform.basis * Vector3(dir_input.x,0,dir_input.y))
if direction:
velocity.x = direction.x * speed
velocity.z = direction.z * speed
else:
velocity.x = move_toward(velocity.x,0,speed)
velocity.z = move_toward(velocity.z,0,speed)
#____________________________________________________________________
velocity.y -= gravity * delta #This is the gravity code!
var just_landed = is_on_floor() and snap_vec == Vector3.ZERO #Checking if the player just landed
var is_jumping = is_on_floor() and Input.is_action_just_pressed("jump")#Checking if the player pressed jump
if is_jumping:#If player press jump, the player jumps.
velocity.y = jump;snap_vec = Vector3.ZERO
elif just_landed:snap_vec = Vector3.DOWN
slide = 3 if dir_input or not is_on_floor() else 0 #the controller won't slide if it's not moving or not in the air!
velocity = move_and_slide_with_snap(velocity,snap_vec,Vector3.UP,true,slide,deg2rad(45))```
There has to be something that I can do to fix this problem. Any advice or pseudo-code that could help? Changing the collision shape would just cause a different set of problems.