A bomb that lands on land should do a different amount of damage to nearby objects compared to a bomb landing on a road or in water.
land.SurfaceType returns the following integers:
LAND 1
SHALLOW_WATER 2
WATER 3
ROAD 4
RUNWAY 5
I've been playing with this using the following code:
local surfaceType = land.getSurfaceType(impactPoint)
if surfaceType = 1 then
surfaceType = 1.25
elseif surfaceType > 3 then
surfaceType = 1
end
explosive = explosive / surfaceType
I'm not 100% sure if a water impact should do more or less damage. The explosion itself won't go as far, but the incompressibility of water transfers pressure to waterborne objects very effectively. The code I posted will make it do less damage.
A bomb that lands on land should do a different amount of damage to nearby objects compared to a bomb landing on a road or in water.
land.SurfaceType returns the following integers:
I've been playing with this using the following code:
I'm not 100% sure if a water impact should do more or less damage. The explosion itself won't go as far, but the incompressibility of water transfers pressure to waterborne objects very effectively. The code I posted will make it do less damage.