I’m trying to bring a simple sprite into my 3d scene and I either get an error saying it is null, or if I call up it as a scene entity, it now doesn’t even show up.
If someone can help me out, it would be awesome.
Here’s my current coding, where I get no errors, but the sprite doesn’t show up.
function setup()
-- Create the scene
scene = craft.scene()
createGround(-.8)
-- Move the main camera
scene.camera.z = -12
mySprite = scene:entity()
mySprite = sprite("Documents:TEXT BUBBLE",WIDTH/2,HEIGHT/2,1024)
-- Adjust the scene lighting
scene.sun.rotation = quat.eulerAngles(30,0,0)
scene.ambientColor = color(10, 10, 10, 255)
-- Turn on fog and set distances and color
scene.fogEnabled = true
scene.fogNear = 2
scene.fogFar = 18
scene.fogColor = color(127, 127, 127, 117)
-- Get the sky material and change the sky and horizon colors
skyMaterial=scene.sky.material
skyMaterial.sky = color(85, 128, 217, 255)
skyMaterial.horizon = color(194, 195, 220, 255)
end
function update(dt)
-- Update the scene (including physics, voxels and other systems)
scene:update(dt)
end
function draw()
update(DeltaTime)
-- Draw the scene (must be done within the draw function)
scene:draw()
end