This is an extremely simple game (following tutorial).
My code and configuration allows the actor object to fall on a platform made of tilemaps and not fall through, but the function is_on_floor() always outputs false.
extends KinematicBody2D
class_name Actor
var velocity: = Vector2.ZERO;
export var gravity: = 3000.0;
func _physics_process(delta):
velocity.y+=delta*gravity;
velocity = move_and_slide(velocity);
if is_on_floor():
print_debug("on floor");
else:
print_debug("not on floor"); #only this line prints
What's going on? Is the is_on_floor() function usable or do I need to use an alternative way of floor-detection?