Jump to content

[Solved] Attempt to index field 'window' (a nil value)?


Recommended Posts

Posted

Hello!

 

So something weird have started happening in the later updates. It now instantly crashes on

 

local mousePos = App.window:GetMousePosition()

With the error

MainMenu.lua" : 2 : attempt to index field 'window' (a nil value)

To try, I tried creating the window with

self.window = Window:Create("Window", 10, 10, 1280, 720, window.Titlebar)

Which results in the same error.

 

Suggestions?

Thanks!

Windows 7 | Intel Core i7-4790K | 16 GB RAM | Nvidia GTX 980

Posted

in main.lua: window=Window:Create(title,0,0,System:GetProperty("screenwidth","1920"),System:GetProperty("screenheight","1080"),windowstyle)

 

in fpsplayer:

local window = Window:GetCurrent()

if window:KeyDown(Key.Y) then

self.camera:SetFOV(20)

end

 

thats how it works fine with my version, the main loop is with a while loop, but I dont know if this inpacts on that.

Posted

Actually, just found the issue, I just renamed my App.lua to Main.lua and it's all good now ;)

Windows 7 | Intel Core i7-4790K | 16 GB RAM | Nvidia GTX 980

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.

×
×
  • Create New...