Sweetgebus Posted December 6, 2023 Share Posted December 6, 2023 I've been struggling with adding a camera to an entity. I get no errors during debug, but when I run the program I get a white screen. Here is the link to the project file.https://drive.google.com/file/d/1YkQFz2wp6OWDCTMAeW3tnALAnKtYxtaE/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
Josh Posted December 6, 2023 Share Posted December 6, 2023 I do not see anything wrong with your setup. I am looking into this further... Quote 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 More sharing options...
Josh Posted December 6, 2023 Share Posted December 6, 2023 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). Quote 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 More sharing options...
Recommended Posts
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.