add vec3.random_normal and fix entities cleanup moment

This commit is contained in:
MihailRis
2024-07-10 00:39:41 +03:00
parent d8c9fa1fe2
commit 257ba86183
4 changed files with 39 additions and 11 deletions
@@ -26,7 +26,8 @@ function on_grounded()
block.set(ix, iy, iz, block.index(blockid))
else
local picking_item = block.get_picking_item(block.index(blockid))
entities.spawn("base:drop", pos, {item={id=picking_item, count=1}})
local drop = entities.spawn("base:drop", pos, {item={id=picking_item, count=1}})
drop.rigidbody:set_vel(vec3.spherical_rand(5.0))
end
entity:despawn()
end