I am wondering if there is a general best practice for collision because I’m having some trouble with consistency.

I’m working on a game and I’ve created collision boxes for walls that the character can’t walk through. They trigger collision flags depending on the direction that stop the character’s motion. The problem is that if the character’s speed is more than 1 pixel per frame, sometimes they completely skip over the edge detection entirely, clip inside and render the collision box useless. I’ve tried adding a bit of a buffer to the edge detection, but it’s becoming unrealistic and over complicated.

Does anyone have any suggestions?

@n0ogit Have you set physics.continuous=true . Look at the reference under physics. It should be at the bottom of the list.

Thanks @dave1707. If it does what I think it does it’ll be a godsend.

@n0ogit That might work under normal collision conditions, but if the object is going too fast, it will still go thru a barrier. More that 1 pixel per frame doesn’t sound fast. Do you have a small example of what’s happening.