Infinite Raycast?


well I know that it is impossible (because the skybox is only a texture, no a solid thing), but I use a sphere that follows the player (so the player is inside it) and the problem is that inside it nothing is detected…

Ray ray = Camera.main.ScreenPointToRay (new Vector3(Screen.width/2,Screen.height/2,0));
RaycastHit hit;
if (Physics.Raycast (ray, out hit)) {
	holdedItem.transform.rotation *= Quaternion.Euler(Slots.HotBarSlots[selectedSlot].FcustomRotation);

That code is for rotate the current object (in the Inventory, but this is not relevant, the only things important is say that the current object is near the camera, so it can be showed by the camera behind him) to the area where the player is looking (exactly on the center of the screen)

But when I look to the sky the rotation return zero (it’s normal because the sky isn’t solid), but as I said before I use a sphere, that is not detected… I don’t know why… D:

So, how can I make the sphere solid in its inside part for make a “Infinite” Raycast system?

Thanks in advance.

Your sphere is not detected, because Raycast can’t detect colliders from the inside. There is a short info about this in the official docs.