Hi Guys,
Actually i am trying to do frist person shooting for that i have to do raycast to check whether the collision is happened.I have a doubt in raycasting can i use screen coordinates for that or using my weapons position as a starting position for raycasting. Help me.
Ray casting happens in world space, but you can transform from any other space: sub object space or screen space, to cast from. So, basically, the answer is both.
Look up the scripting documentation for raycast. Oh and don’t raycast blind! You’ll poke someone’s eye out, look at Gizmo.DrawRay and Gizmo.DrawLine, you’ll want to use those to visualize the ray being cast.