Refpeuk wrote:I would still love to know why my fps is capped without me writing any code to do so, but it isn't for others.
Also, should I write dt into all the physics stuff, or does that happen automatically with world:update(dt)?
Thanks again
It depends on your video card. Some automatically cap at 60, others don't. A lot of onboard video chips do not cap themselves.
You should write dt into practically everything that updates. Physics, animations, AI, you name it. It's not that hard once you get used to it, you just have to get your head wrapped around the idea "if this doesn't happen in one frame, I need to use dt."
Yes, it does, thankfully, most libs (both inbuilt and found on the forums) already care about dt, and if you have an update function that wants dt, you can probably assume it does.
OK, I've written dt into everything that I think would be affected. (animations and physics already had it)
I also added a roll with shift. The animation isn't speed-sensitive yet, and cancels as soon as you let go of shift. The biggest issue however is that when rolling under a block the player still inexplicably slows down. I was wondering if anyone could tell me why this is?
The way I have it working is now the player has two collision shapes, upper and lower, and whenever he is rolling (same for crouching, sliding, etc) the top one is set as a sensor so that it doesn't collide with anything (I assume this is the most efficient way to do it), and when <shift> is released it's set back to normal.
Refpeuk wrote:The biggest issue however is that when rolling under a block the player still inexplicably slows down. I was wondering if anyone could tell me why this is?
It's your player.sensor stuff, the left and right checks are zeroing the x velocity when they "hit" the block, you could split it up into an upper and lower collision, and mask the uppers when rolling.