Hi, I want to make a bomb explosion for a fps bomberman, I mean, there are obstacles in the map, and those obstacles block other obstacles, have a scheme of what I mean
as you can see on the image the bomb uses a overlap sphere, I want to raycast to all objects inside of it tagged as “brick” or “player” (Quite easy to understand which one is which I guess), basically you can see on this video from SuperBossGames: Intruder Series 002 Concussion Grenades - YouTube, put the video at 1:30. So from that video is really easy to understand what I want, in the image I did I putted attention signal in one of the brick boxes because the raycast hits the other brick box instead, so that box shouldn’t be affeced, just like the grenade from the video, if the raycast hits another object instead, you aren’t affected.
Also you can see how is my script at the moment:
#pragma strict
var power : float = 100;
var damage : int = 1;
var radius : float = 3;
var bombFuseLength : float = 3;
private var startTime : float;
private var actualTime : float;
function Start ()
{
startTime = Time.time;
}
function Update ()
{
actualTime = Time.time - startTime;
if (actualTime > bombFuseLength)
{
Explode();
}
}
function Explode ()
{
GameObject.Find("First Person Controller").GetComponent(Player).bombs +=1;
var colliders : Collider[] = Physics.OverlapSphere (transform.position, radius);
for (var hit : Collider in colliders) {
if (!hit)
continue;
if (hit.rigidbody)
hit.rigidbody.AddExplosionForce(power, transform.position, radius, 3.0);
Destroy (gameObject);
}
}
function OnDrawGizmos ()
{
Gizmos.color = Color(1,1,1,0.5);
Gizmos.DrawSphere (transform.position, radius);
}
it got kinda deformed when I putted it into unity awsers but it’s readable and I think you can understand what I want to do.
thanks in advance.
edit: Ok I looked at my script and I se I already have a little thing for that ( this script was made by a friend and it was some time ago), but I have no ideia on how to use it to do what I want, by the way, please tell me how to debug a ray is it on OnDrawGizmos also? I think it would be very helpful to see what will happen

@MadJohny - back on 3/7 you asked an nearly identical question, and I posted some code to do the testing for you. Did that code not work? [http://answers.unity3d.com/questions/412675/sphere-cast-thing-help-please.html][1] [1]: http://answers.unity3d.com/questions/412675/sphere-cast-thing-help-please.html
– robertbuI know, but that code was kinda confusing me, that code may be good, but I would like if you explain it a little bit, I also did this other question because I think this one is kinda easier to follow, it may be bigger, but it as an image, and you also can see my script, so if you don't mind please explain me a bit of your script, and where to apply it on mine. AAANNDD I didn't even knew what a array was in that time, I learned it yesterady to create a obstacle random spawner.
– MadJohnyand what do you mean with raycasting to the corners?
– MadJohny