Sokiyo Posted June 14, 2015 Share Posted June 14, 2015 I'm trying to get Barrels to fall from a certain point every 1.5 seconds. I have the spawn point in for it and everything. When I click "Run", the barrel is in the sky where it should be falling from but it doesn't fall, and no more spawn in. How do i get it to spawn in every 1.5 seconds and fall down? The script I have for it: 1.)Script.spawnObject = "" --entity "Spawn object" 2.)Script.spawnTime = 1.5 --float "Spawn time" 3.)local timer = 0 4.) 5.)function Script:UpdateWorld() 6.) timer = timer + (Time:GetSpeed()/100) 7.) if(timer > self.spawnTime) then 8.) local newObject = self.spawnObject:Instance() 9.) newObject:SetPosition(self.entity:GetPosition()) 10.) timer = 0 11.) end 12.) 12.)end Also, I do have the Barrel set as the spawn object for the spawning point, and the script is attached to it, as well. Edit: I forgot to mention. I'm using Lua Quote Link to comment Share on other sites More sharing options...
nick.ace Posted June 14, 2015 Share Posted June 14, 2015 Does the barrel have mass or a physics shape attached to it? You could be spawning in a new barrel like you described, and it looks like one because it is in the same position. http://www.leadwerks.com/werkspace/page/tutorials/_/scene-panel-r3#section2.3 Quote Link to comment Share on other sites More sharing options...
Sokiyo Posted June 14, 2015 Author Share Posted June 14, 2015 Solved. Thank you It had a Mass of 0.0, thank you for making me check that. It's always something so simple that gets me. 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.