Hey guys, I have a script that makes a new body when a lever is pressed, however, the problem is that the script that makes the new body is in love.update so it can appear whenever I want it too. Therefore, when I load a new map, and say platform.b:destroy() (the body in question) the platform does not get destroyed, what do I do? Here is the script and love file:
I found your problem. When you flip the lever you're changing lever_pressed==true which creates the platform body dynamically.
Then... each time the love.updatemap() function is called, lever_pressed is still true and creates another platform body, and another...
If you restrict this to just one then it works fine.
Hope this helps
By the way, since you are using love's physics library, why do you need to check for collisions?
It helped a lot thank you I check for collisions because I want the character to change when it hits the platform or the ground. So when it is not on the ground or on the platform, the character is in a jumping animation thank you very much.