Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Physics Raycast

Hi recently I made a grappling game where player had to grapple on to cubes and complete the level. There i used raycasting but now I'm able to raycast into air and grapple into air any ideas how to fix it Please Help

Best Answer

  • JIMMY_VASHI04JIMMY_VASHI04 Member
    edited July 2020 Accepted Answer

    You can check if the ray hit the certain tagged object like

    RaycastHit hit;
    If(Physics.Raycast(origin,direction,out hit,max distance)){
       If(hit.tag == "cube"){
          //grapple 
       }
    }
    
Sign In or Register to comment.