mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add drop.json
This commit is contained in:
parent
8d41f6af11
commit
20ab48ecab
8 changed files with 28 additions and 13 deletions
|
|
@ -5,7 +5,7 @@ function on_hud_open()
|
|||
input.add_callback("player.drop", function ()
|
||||
local pid = hud.get_player()
|
||||
local pvel = {player.get_vel(pid)}
|
||||
local eid = entity.test()
|
||||
local eid = entity.spawn("base:drop")
|
||||
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
|
||||
entity.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue