- Home /
Massive framerate fall with Character Joint
Hello everyone,
I have a problem happening mainly on android smartphone, but I think it's more because of the performance.
Here is the thing. I have a rope made of several nodes - containing Character Joint, Rigid Body and Collider - connected to 2 points, one fixed and the other movable. When the rope is too tight, I add nodes, when it's too slack, I remove. The scene is in 2D, subject to Gravity.
In default case, without any collision there's no problem and the rope respond correctly to any movement of the second point. When this point collide with an obstacle, and that I readjust its position to stay on the edge, the rope work fine too. But if I try to make this point slide against the obstacle, really often the framerate is totally out of control (in the order of 1 to 2 second by frame).
After many tests and profiling, I can say it's because of the automatic readjustment of Character Joints, and happening mainly when I stretch the rope, but I can't find why, neither correct it. Some frame it works, and at a moment, the Physics.Simulate take between 500ms to 2000ms, and then never go back to a normal value, whatever I do. And I can't see further what's happening in this Physics.Simulate and in Character Joints readjustment.
If I deactivate Joints, there's no problem (but I haven't a rope behavior anymore). If I don't make this slide movement, there's no problem. But each point movement is just a manually affectation, and only this slide one fail, even without any calculation. I even tried to change time step or solver iteration count values, without any success.
I think it's a problem in Character Joints readjustment, maybe with Colliders. This problem is obvious on ARMv6 (provoking the game been totally unplayable), on ARMv7 there is a visible framerate fall (the game still remains playable), but of course it's undetectable on PC.
Does anyone have an idea of what could be the problem here, how I can found it, or of course how to solve it ?
Thanks in advance.