- Edited
cybereality It seems I'll never be able the completely get rid of the bounce completely. The problem isn't as extreme as it once was as the controller doesn't bounce extremely high anymore. The bounce only happens if the player were to climb the slope from a particular angle/direction; it can only be done frequently from someone who's trying to break the game intentionally. However, it's still a think. Not a big think but, still undoubtably a thing. I don't know what else to do about it.
Here is what my code looks like now:
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 = velocity.y - (gravity * delta) if not is_on_floor() else 0.0 #This is the gravity code!
if is_on_floor() and Input.is_action_just_pressed("jump"):#Checking if the player pressed jump
velocity.y = jump
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(velocity,Vector3.UP,true,slide,deg2rad(45))``