CharacterBody2D collision doesnt trigger when character is moving down

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

I have a CharacterBody2D, animated sprite and collision shape as children, that moves with a script and emits a signal on collision:

extends CharacterBody2D

@export var speed = 300
var screen_size = Vector2(1152, 648)

signal car_crashed

func get_input():
	#if Input.is_action_pressed("shift"):
		#speed = 400
	#else:
		#speed = 300
		
	var input_direction = Input.get_vector("left", "right", "up", "down")

	velocity = input_direction.normalized() * speed
	position.x = clamp(position.x, 0, screen_size.x)
	position.y = clamp(position.y, 0, screen_size.y)

func _physics_process(delta):
	get_input()
	var move = move_and_slide()
	if move:
		car_crashed.emit()

The signal is connected to a Node2D in the main scene, which reloads the scene when the CharacterBody2D collides with something:

func _on_car_car_crashed():
get_tree().reload_current_scene()

When moving up, left, or right this works as intended, however when moving down the collision doesn’t seem to trigger.

The bodies that it collides with are also CharacterBody2D which are moved by a script:

extends CharacterBody2D

var screen
@export var speed = 300

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
	velocity = Vector2(0,speed)
	move_and_slide()


func _on_visible_on_screen_notifier_2d_screen_exited():
	queue_free()

Rather than colliding as intended, it seems to push the object. If I try to move up the collision is detected and the scene is reloaded, but I’m at a loss on how to handle this.

video example (notice powerlines)