Jump to content

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


Kraxie
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

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...