Collision Kinematic Body2D

: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 in Godot as a practice, not for selling and I want to detect the collision between a kinematic body and a rigid body. So far so good, the player (kinematic body) can stand on the rigid body, but I don’t have a get_colliing_bodies function for kinematic body.
Here is the player code:

extends KinematicBody2D

export var viteza = 30
var animNod
var jumped = false

func _ready():
	animNod = get_node("AnimatedSprite")
	set_fixed_process(true)
	
func _fixed_process(delta):
	
	#MISCARE
	
	delta *= 10
	var misc = Vector2(0,1)
	
	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"
	
	if((Input.is_key_pressed(KEY_SPACE) or Input.is_key_pressed(KEY_W)) and not jumped):
		jumped = true
		var hVector = Vector2(0, -1)
		var hSpeed = 2
		var jH = 50
		hVector = hVector * (delta * hSpeed)
		newAnim = "saritura"
		var height = get_pos()[1]
		while get_pos()[1] > height - jH:
			self.move(hVector)
	
	animNod.play(newAnim)

How to detect collisions between them?

:bust_in_silhouette: Reply From: quijipixel

KinematicBody2D has a method called is_colliding. You can get the collider with get_collider.