Jump to content

White Screen when trying to add camera to entity.


Sweetgebus
 Share

Recommended Posts

The problem is that your Lua file is called "Marble.lua" but your class is called "marble". I am not exactly sure yet why that should matter, but when I changed the case it worked:

Marble = {}

function Marble:Start()
    self.camera = CreateCamera(self.entity.world)
end

function Marble:Update()
    local window = ActiveWindow()
    if window ~= nil then
        if window:KeyDown(KEY_W) then
            self.entity:AddForce(1,0,0)
        end
    end
end

RegisterComponent("Marble", Marble)

return Marble

I also noticed your JSON file uses the extension ".Json". While this won't cause any problems on most systems, it could be an issue in the future if your game runs on Linux, and I recommend always using a lower-case file extension (.json).

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...