So basically, here is the code I have:
extends KinematicBody2D
func _process(delta: float) -> void:
_moveToMouse()
func _moveToMouse():
var direction = get_global_mouse_position() - position
move_and_slide(direction)
And I have a little ColorRect as the sprite and Collision Box but the square doesn't go where the mouse is, instead it's like a couple meters behind it or something.
Here is a video:

Why is it doing this and also, how would I make it collide with everything but the tile map?
I've sort of fixed it by using the code shown below but I don't want it to move and slide... well I do but I want it to go faster.
extends KinematicBody2D
func _ready():
position = Vector2(0, 0)
func _process(delta):
var direction = get_local_mouse_position()
move_and_slide(direction)