O'Reilly logo

Unity 2D Game Development by Dave Calabrese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Got a glitch?

Now, you may have noticed a small glitch if you are holding down your jump button. The player can occasionally get stuck in the ground and then refuse to move or jump. The reason for this is how physics are checked. When objects are moving fast, often they will actually intersect another object before the collision detection occurs. This happens so fast your eyes will rarely ever actually notice it—but to the game's physics, it can mean the difference between working and... freezing in one place. We're now going to improve the capabilities of the state system to address this.

What we are going to do is add the ability for states to have a conditional check and, if certain conditions are true, abort them from occurring. We are then ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required