mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add on_update event
This commit is contained in:
parent
bb1c0b4b44
commit
982c8b132d
7 changed files with 41 additions and 10 deletions
|
|
@ -1,9 +1,11 @@
|
|||
function on_despawn()
|
||||
print("despawn")
|
||||
end
|
||||
|
||||
inair = true
|
||||
function on_grounded()
|
||||
entity.transform:set_rot(mat4.rotate({0, 1, 0}, math.random()*360))
|
||||
print(stdcomp)
|
||||
entity:despawn()
|
||||
inair = false
|
||||
end
|
||||
|
||||
function on_update()
|
||||
if inair then
|
||||
entity.transform:set_rot(mat4.rotate(entity.transform:get_rot(), {0, 1, 0}, math.random()*32))
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue