Hi there! I love Lua but I’m new to Codea. Just trying to get one of these models to appear on screen. I’m using an example but all that appears when I run is the gradient from the sky. Where is the entity I created? Any help is much appreciated!
I’m also unsure of how to tag code in this forum so apologies for the sloppiness…
-- Craft Template
function setup()
-- Create a new craft scene
scene = craft.scene()
-- Move the main camera position
scene.camera.position = vec3( 0, -20, 0)
-- Adjust the scene lighting
scene.sun.rotation = quat.eulerAngles( 45, 0, 45)
scene.ambientColor = color(181, 98, 98, 255)
-- Get sky material and alter sky and horizon colors
local skyMaterial = scene.sky.material
skyMaterial.sky = color(0, 221, 255, 255)
skyMaterial.horizon = color(0, 0, 0, 255)
-- Create a new entity
local e = scene:entity()
e.model = craft.model("Blocky Characters:Adventurer")
e.eulerAngles = vec3( 45, 0, 45 )
e.z = -10
end
function update(dt)
-- Update the scene (physics, transforms etc)
scene:update(dt)
end
-- Called automatically by codea
function draw()
update(DeltaTime)
-- Draw the scene
scene:draw()
end