meat_madness_redux/godot/player/CloseToFloor.gd

14 lines
269 B
GDScript3
Raw Normal View History

2022-11-27 19:55:11 -07:00
extends RayCast
var is_on_floor = false
var floor_distance = 0.0
func _process(_delta):
force_raycast_update();
if is_colliding():
is_on_floor = true;
var point = get_collision_point();
floor_distance = to_local(point).length();
else:
is_on_floor = false;