Are you sure that you need RayCast2d in Hook scene ?
All work is done by SnapDetector.
Also I printed owner.ray_cast.cast_to.length() in Aim.gd, value is always between 461 and 459
Yes, sure, it's used to prevent the player from hooking onto a target when there's a thin obstacle between the player and the hooking point.
In script of SnapDetector exists code to prevent that.
func find_best_target() -> HookTarget:
# Skip the target if there is a collider in the way
ray_cast.global_position = global_position
ray_cast.cast_to = t.global_position - global_position
if ray_cast.is_colliding(): <------------- here
RayCast2d in Hook scene is used only in Aim.dg script.
Ah I see. The one in the Hook scene has a different purpose: it gives you support for hooking onto surfaces instead of HookingPoint instances, like a wooden wall or a special ceiling.
Not sure I got to integrate it into the tutorial's demo, unfortunately, I ran out of budget for this project (the course didn't sell at all initially).
Aha, I get it :D
I am so sorry to hear that :/ The course is great. I learned a lot.
Have you thought about making some mobile game tutorial?
Sure, I thought about it. Got other plans for now.