I set the ray_cast to top level, and updated ray_cast.global_position to the SnapDetector's global position in find_best_target. However, the raycast appears to be coming from way in the upper-left of the screen (outside of the viewport in fact). I created a separate project to test global_position setting, and I am getting similar behavior. Is there some sort of setting in Godot I need to set to correct this? I am on v3.2
Could you share your project as a zip archive with me? I need to look at the code and node structure to see what's going wrong.
You can upload it to a website like wetransfer, dropbox, etc.