How to determine hit collision

Hey, Your setup is indeed quite simple but adding screenshots always helps people understand and it gives context imho. Could you show your hit scan code please.