Thank you for your help,
Yes, the collision is definitely not being picked up; you are right.
I have a Collisionpolygon2D for my Player and a CollisionShape2D for my Sprite as children.
Unfortunately it is still not working--and I don't an error message, the player just passes right through the Sprite. Here is the code as it looks now:
func on_body_entered(area: KinematicBody2D) -> void:
And, this is the script for my Player (in case this helps solve the problem):
var run_speed = 400
var jump_speed = -1100
var gravity = 2000
var velocity = Vector2()
export (int) var speed = 200
velocity.x = 0
var right = Input.is_action_pressed('right')
var left = Input.is_action_pressed('left')
var jump = Input.is_action_just_pressed('jump')
if is_on_floor() and jump:
velocity.y = jump_speed
velocity.x += run_speed
velocity.x -= run_speed
velocity.y += gravity * delta
velocity = move_and_slide(velocity, Vector2(0, -1))
I used a signal to link the
on_body_entered and connected it to my Sprite. Not sure if I connected it correctly.
Many thanks for any other thoughts!!