tinyboss Posted November 13, 2014 Share Posted November 13, 2014 Note: I'm very new to Leadwerks, so most likely I'm missing something obvious. I've created a 512x512 floor block and I'm trying to load a 4x4 square of them with the following code: --Dynamically create some dungeon geometry: System:Print("loading dynamic floor") self.floors = {} for i = 1, 4 do for j = 1, 4 do floor = Prefab:Load("Prefabs/Tinyboss/floor2.pfb") table.insert(self.floors, floor) floor:SetPosition(2048+512*i, 0, 512*j) System:Print(floor:GetPosition().x.." "..floor:GetPosition().y.." "..floor:GetPosition().z) end end self.FirstTime = false (I put it at the end of the App:Start function in app.lua. I also tried running it once in the App:Loop function, but that didn't help.) When I run with F6, I see all the stuff that I've added in the editor, but none of the dynamically loaded floor tiles show up. I can tell from the print statements that entities are getting loaded and their positions are being set, but I don't see any of them. Is there something else I need to do to add them to the current scene, or something else I'm missing here? Thanks! Quote Link to comment Share on other sites More sharing options...
Genebris Posted November 13, 2014 Share Posted November 13, 2014 In code you set position in meters so I guess you are simply placing your prefabs too far away. 1 Quote Link to comment Share on other sites More sharing options...
tinyboss Posted November 13, 2014 Author Share Posted November 13, 2014 Bingo! Thanks! Quote 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.