Well, now I have an issue that I really don’t know how face it. In short, the problem is I have an unexpected frame rate drop during the FIRST collision in-game. It’s just for a half second and occurs inmediately after first collision. All goes pretty fine after that.
May be don’t looks like a huge problem, but it produces a physics undesired behaviour that ends with the main character flying away billion mph.
So far I’ve patched(tatty) the code to minimize the effect, but problem is still there and corrodes my pride be unable to find out why it is produced.
Sorry I can not give more information than this, but this is all. Isn’t a complex scene. It’s Just a capusle collider with few box colliders.
PD: I’m working with small devices (smartphones and tablets).
it’s probably still recovering from setup with the garbage collector kicking in. Allow for at least 1 second of doing nothing when loading in levels if you’re allocating stuff in Start() etc.
Thanks for answering, but FPS drop don’t occur at the start, but when the character collides first time. If this collision occurs after 5 os 10 seconds, FPS drop comes at that moment.
Definitely not normal. I suspect it’s probably something your scripts are doing.
Make a new empty scene with nothing but a box with gravity and a static plane. Let the box fall on to the plane and see if you get the same hiccup. If you do, I guess it’s a Unity bug that only you are seeing for some reason, but I doubt you will see a problem… which means the collision system is working fine, it’s something you’re doing upon collision slowing things down.
What does this mean? Patched what code? How has is minimized the effect?
I actually let multiple floats build up by deltatime all the time. After the float hits it’s target length, I reset them and let deltatime build all over again. Typically I would use this to instantiate gameObjects. Is this practice not okay?