|
I was wondering if it is possible to have a object shoot out rays in all directions. I want this for a grenade, as i want it so when the grenade blows up it shoots out rays in all directions, and if a ray hits something it will apply damage. I want to do it with ray casting because i want it so if the player is behind cover they will not get hurt, unlike if i spawned a trigger to check for collisions with player, as that would go threw walls. IF you got a better way of doing it please tell me otherwise help me the best you can. Also, can you have it set so it will calculate the length of the ray? U would like that as it would make it easier to apply damage, if the player is on top of the grenade it is instant death, within 1 meter is half health, and within 5 meters is 25% of the health. I would set the ray to be about 6 meters long if i could calculate the length of it.
(comments are locked)
|
|
I would do these calculations in the opposite order:
For more information, see this answer which discusses how to apply damage which falls off within a certain blast radius, and just add the raycast test to it, to check for cover.
If you're using rigidbodies for your enemy objects, you could also use AddExplosionForce to add a proximity based force to push them away from the explosion centre.
(comments are locked)
|
|
If you enable the Maximize on Play button in the Game window, the Game Window will expand when you hit play and get small again when you stop. The downside to this is that you can't see the inspector/hierarchy windows without opening them manually. You are right in this aspect
(comments are locked)
|
