Could you add a DebugLog function?
Debug.Log("Raycast is working
what is not?"); - something like that, based on what the lang you are using. Make sure aswell you are using the mouse 1 input, if you insert that little piece of code into your raycast function then it should have that message at the bottom in the console view. If it does show, then your raycast function works, if not then you have a raycast error and you may need to reformat the way you scripted it. If it does work, then you have a problem with the code within your raycast function, this could be just a simple grammatical error.