Player Physics

Motivation

From the outset, we wanted our game to be a platformer focused on speed and agility. Thus, our player character has the ability to run, jump, wall jump, and wall slide. My primary focus during development was on making all of the physics for these actions “feel right.”

Design

GuildEd had a solid integration setup for its physics, but its collision system had some small issues. In particular, the detection for the ‘on ground’ state was glitchy, and there was no detection for whether the player was touching a wall or not.

Fortunately, GuildEd did provide a very useful raytracing function, which I used for my solution. I created a pair of raytracing ‘sensors’ on the bottom and both sides of the character. As you can see in the video, they are designed to be very tight to the collision box and shoot in both directions. If either one of the raycasts impacts the environment for that side of the character, it sets the ‘on ground’ or ‘on wall’ state. This setup worked well enough to make it into the final game build.