Raycast in camera

How would one go about casting lots of rays inside of the cameras bound, plus a little extra on each sides ?

Might need a bit more information to get you the right answer, but I can give it a shot with what you got. Reading a bit into the missing pieces I’m guessing you’re trying to check if something can be seen from your camera… below is various ways to check:

The important vector for Rays from the camera is direction. You can get access to this from the transform: camera.transform.forward. From there, you can cast a ray in that direction from the camera’s position for as far as you want.

Now, if you’ve got a target you’re trying to see if you can hit… you can do this more easily, by ditching the direction and using the target’s position to figure out the direction vectory like so:

RaycastHit hit;
float distanceToCheck = 100f;

if (Physics.Raycast(camera.transform.position, (target.transform.position - camera.transform.position).normalized, out hit, distanceToCheck) {
    // can check what hit landed on

Further though, if you wanted to check if your target was in the frustum of the camera you can do so like:

Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera);

if (GeometryUtility.TestPlanesAABB(planes, target.renderer.bounds)) {
    // target is in the camera frustum...

Hope this gives you enough to get you objective done. If not, provide some further information and I can edit if necessary.