add debug hitboxes render

This commit is contained in:
MihailRis
2024-06-25 20:11:46 +03:00
parent ee7328dcad
commit f3c5afa1ab
5 changed files with 33 additions and 6 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
local DROP_FORCE = 8
local DROP_INIT_VEL = {0, 3, 0}
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()
entity.set_vel(eid, vec3.add(vec3.mul(player.get_dir(pid), {8, 8, 8}), vec3.add(pvel, {0, 3, 0})))
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)
end