Search found 6 matches

by war_man333
Thu May 29, 2014 12:14 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Re: Using body:destroy() without the game crashing

If you're using Mogamett, do self.dead = true and the physics object will be destroyed next frame. You can't change a physics object from the callback function. If you have more questions like those use the comments section on the related page on the Mogamett site, since I get an e-mail notificatio...
by war_man333
Wed May 28, 2014 8:43 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Re: Using body:destroy() without the game crashing

right... Im having trouble following the code, never worked with mogamett before. To help direct me, tell me the file, line number(if possible) and line of code(s) you change to cause the body to be destroyed, also where do you store the reference to the projectiles upon their creation? ie, do you ...
by war_man333
Wed May 28, 2014 7:15 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Re: Using body:destroy() without the game crashing

Here's the code:
game.rar
(452.54 KiB) Downloaded 266 times
by war_man333
Wed May 28, 2014 6:23 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Re: Using body:destroy() without the game crashing

anyhow, the point made is : is the Projectile object also destroyed and any attempt to draw it stopped(as it shouldnt exist anymore) or is there perhaps something somewhere still calling the function that draws the object? I don't know how to destroy the object, I just want the entire object, body,...
by war_man333
Wed May 28, 2014 4:43 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Re: Using body:destroy() without the game crashing

Hi, welcome to the community! :) Sorry, but we can't help you without more information: a .love would help. As for my guess, you're trying to access it after you've destroyed it. This is like trying to access a variable you're already "nilled". You need to check whether the variable still...
by war_man333
Tue May 27, 2014 5:49 pm
Forum: Support and Development
Topic: Using body:destroy() without the game crashing
Replies: 10
Views: 6867

Using body:destroy() without the game crashing

I'm trying to remove a body, but I get an error for using the body after I have removed it. function Projectile:onCollisionEnter(object, contact) self.body:destroy() end There's still references(?) to the body, specifically it keeps running 'self:physicsBodyDraw'. Sorry for being clueless and new, b...