So I've been using the exact 2D code from here: http://docs.godotengine.org/en/stable/tutorials/ray-casting.html on a KinematicBody to cast a ray:
func _fixed_process(delta):
self.look_at(global.PLAYER_POS);
var space_state = get_world().get_direct_space_state();
var result = space_state.intersect_ray(get_global_pos(), global.PLAYER_POS, [ self ] );
But it returns:
Nonexistent function 'get_space' in base 'KinematicBody2D
Any idea what might be causing this behaviour?
Thanks!
Avery