Physics objects going though eachother

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Seth

I must be doing something wrong, because my player character just keeps going through the floor I made? This isn’t the first time I’ve done this, and it’s worked before! But for the life of me I can’t figure out what’s wrong this time.

Here is the setup I have:
(the floor is a door because it’s what was on my desktop)

There are the nodes:
here's the node's and stuff

the code looks like this:

extends KinematicBody2D

const UP = Vector2(0,-1)
const SPEED = 200
const GRAVITY = 10
const JUMP = 500

var motion = Vector2( )

func _physics_process(delta):
motion.y += GRAVITY

if Input.is_action_pressed("move_left"):
	motion.x = -SPEED
elif Input.is_action_pressed("move_right"):
	motion.x = SPEED
	motion.x = 0


And this is what happens, and I can’t figure out why
cool gif I made

It’s probably something really simple, so like… please help.

:bust_in_silhouette: Reply From: kidscancode

Area2D does not provide collision. It is for overlap detection and area influence. Your floor should be a StaticBody2D.

See here for details: