Files
WickedEngine/Content/scripts/rotate_model.lua
T
Megumumpkin da6a2e53ba New Lua Scripting (#501)
* New Lua Scripting System

* Update Scripts

* Small fix on wiLua Globals

* Add One More Note To The New Demo

* -path fix
-renamed new_script_demo.lua to script_tracking.lua
-refactors
-version bump to 0.71.0

* removed GetScriptPath()

Co-authored-by: Turánszki János <turanszkij@users.noreply.github.com>
2022-08-07 18:26:28 +07:00

19 lines
541 B
Lua

-- This script will load a teapot model with lights and rotate the whole model
killProcesses() -- stops all running lua coroutine processes
backlog_post("---> START SCRIPT: rotate_model.lua")
scene = GetScene()
scene.Clear()
model_entity = LoadModel(script_dir() .. "../models/teapot.wiscene")
transform_component = scene.Component_GetTransform(model_entity)
runProcess(function()
while true do
transform_component.Rotate(Vector(0, 0.1)) -- rotate around y axis
update()
end
end)
backlog_post("---> END SCRIPT: rotate_model.lua")