Player moves slowly on surface

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By edimemune
:warning: Old Version Published before Godot 3 was released.

I am working on a game with a ball and I created the basic movement, but when I move on ground surface, the ball moves very slowly.
An screenshot from the project:

https://drive.google.com/open?id=0BxW0b-YjQRdXUmI0MVpNS29UVDQ

And the code attached to the ball:

extends KinematicBody2D

export var viteza = 30
var animNod
var jumped = false
var falling = false

var y

func _ready():
	animNod = get_node("AnimatedSprite")
	set_fixed_process(true)
	
func _fixed_process(delta):
	
	#MISCARE
	
	delta *= 10
	var misc = Vector2(0,1)
	
	if(jumped):
		if(get_pos()[1] > y and not falling):
			print("Da")
			misc[1] = -1
		elif(get_pos()[1] <= y):
			falling = true
	
	if(Input.is_key_pressed(KEY_D) or Input.is_key_pressed(KEY_RIGHT)):
		misc[0] = 1
		
	if(Input.is_key_pressed(KEY_A) or Input.is_key_pressed(KEY_LEFT)):
		misc[0] = -1
		
	misc = misc * (delta * viteza)
	
	self.move(misc)
	
	#ANIMATIE
	
	var newAnim = "idle"
	
	if(Input.is_key_pressed(KEY_D) or Input.is_key_pressed(KEY_RIGHT) or Input.is_key_pressed(KEY_A) or Input.is_key_pressed(KEY_LEFT)):
		newAnim = "mers"
	
	#Jump --->
	
	if((Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_W)) and not jumped):
		jumped = true
		var jH = 50
		y = get_pos()[1] - jH

	print(jumped)	
	#<--- Jump
	
	animNod.play(newAnim)
	
	var corp = get_collider()
	if corp != null:
		if corp.is_in_group("sol") and falling:
			jumped = false
			falling = false

What is wrong?

:bust_in_silhouette: Reply From: Serenade

Well, you have a very unusual way to make physics… but you need to youse "slide()"for this, cuz otherwise it still tries to go trough the ground…

if is_colliding():
var n = get_collision_normal()
(then add forces to be equal to n.slide())
HERE is awesome channel that covers this topic too… it will be more use then me : D

slide() instead of move()?

edimemune | 2017-09-14 07:15