I have a game that uses physics. Now, when my object is about to collide with another physics object (so before the collision has even taken place) the game lags ever so slightly.
This has been happening for the last 20+ or so versions, and I'm not sure what's causing it. I'm using the Box2D web physics because I frequently disable and enable collisions between these objects.
Additionally, I recall hearing about a certain order you need to run the collisions, but I don't recall fully understanding it at the time of reading, let alone now a few weeks/months down the line.
I am assuming the slowdown is related to the collisions... it may be something else, but it is a bit odd that it will only slow down when it's approaching another object. If anyone has any clue how to help, I'd appreciate it.
Because they are physics objects, they sort themselves out, I don't need to add anything in... However, upon collision, the objects have an instance variable that changes. That's about it.