How would i get RaycastHit position in this case?[UPDATED]

-Reformulated question-

Hey guys, i have a problem var Money : int = 1000;var test = 0;var test2 = 0;var spawn1 = 0;var pre - Pastebin.com if you look at this code, line 26, i try to create an object at the position of the object i selected + x 2. But what happens here is that the location defaults to 0,0,0 + 2,0,0 instead of making the location at the selected object + 2,0,0. How do i fix this?

I didn’t understand the whole logic, but usually you should check if something was hit in the last if prior to use hit.point - you could use the variable test in this case:

    if (test == 1 && spawn1 == 1){
        var prefab = Instantiate(....);