hmm, well my understanding 2D physics is limited i usually default to 3D and restrict the Z perhaps u could do this as a last resort.
also i’ve noticed u have hit1 for the name of your raycast but this section
hopefully this helps, its been a long time since i used JS so my knowledge is limited, appologies for the long winded answer wanted to make sure i covered everything, lastly if it doesn’t work
i recommend using some debug.logs similar to the following to determine whether your values
are being set correctly.