xyz Well, I hoped I wouldn't have to do that if I use the profiler. It did point me in the right direction at least, the problem was physics related. I use a somewhat complex mesh for the world and I had to check if an enemy is on the floor using test_move() instead of is_on_floor()(for reasons). Instead of doing that I added an Area3D and check if it has overlapping bodies, which seems to work just fine and the lag spikes are pretty much completely gone. Now I just need to figure out how I can make the world collision mesh simpler or split it into multiple parts, not sure if that will actually help though.