Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Before you make a thread asking for help, read this
- Posts: 8
- Joined: Tue Jul 01, 2014 5:56 pm
I have a little problem.. I'm stuck in the error "Attempt to use a destroyed fixture" and I can't find a solution..
How do I check if a fixture is destroyed or not? I tried with "a==nil" (a is the fixture) but is not nil,is just destroyed..
Also every method I try to apply to the fixture like a:getBody() return the error..
I want to do an if statement like
Code: Select all
if *the fixture is destroyed* then
--do the work with the fixture
- Party member
- Posts: 259
- Joined: Tue May 29, 2012 6:46 pm
- Location: Egypt
This is generally a code design flaw.
Why is it that your code is trying to use a destroyed fixture anyway? If you're keeping them in an array, make sure you remove the destroyed ones, or mark them as destroyed in a table until they get removed.
Alternatively, you can try running a test through pcall, to catch the error, but you should really redesign your code to avoid this situation in the first place.
If you can give more info on how things are set up we can try to come up with more specific solutions
Users browsing this forum: No registered users and 7 guests