Raycast in a cone?

I need to raycast in a array in the shape of a cone base on angle and height, light a spotlight:
image

I can’t use random lines in a cone since I’m using it for a light baking engine and I obviously can’t use shapecast for it.

Does anyone know of a method?

didnt you just ask for raycasting a sphere, now a cone??

ps - “don’t ask people for code”

I’m not quite sure what you’re asking, but does this work for you?

Edit: or possibly this, which spreads the lines out evenly?

2 Likes

The fact that you answered this same question not twice but three times over the past 2 years is amazing.

2 Likes

I didn’t ask for code, I asked for a way? Not to mention the last one I had code but needed it to go in 3 dimensions.

You really just need to pick points in a circle. Basically take a slice of the cone, and cast from the top of the cone through points in the circle you’ve sliced out of the cone. The specifics of how to pick those points on the 2D circle can change based on your goals. Specifically you need to pick an algorithm that distributes the points in the way you want or is at least usable.

1 Like

hey i think i can help you is this something you are looking for?