mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
make core:mob.look_at public
This commit is contained in:
parent
3c2061f788
commit
23a9ad0979
3 changed files with 32 additions and 30 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue