make core:mob.look_at public

This commit is contained in:
MihailRis
2025-09-07 23:41:29 +03:00
parent 3c2061f788
commit 23a9ad0979
3 changed files with 32 additions and 30 deletions
+4
View File
@@ -1,3 +1,4 @@
local tsf = entity.transform
local body = entity.rigidbody
local mob = entity:require_component("core:mob")
@@ -54,6 +55,9 @@ function on_physics_update(tps)
local delta = (1.0 / tps)
local pid = entity:get_player()
if pid ~= -1 then
local pos = tsf:get_pos()
local cam = cameras.get("core:first-person")
process_player_inputs(pid, delta)
mob.look_at(vec3.add(pos, cam:get_front()))
end
end