After discovering everything that the Complete Physics Platformer kit has to offer, I knew the time would come that I would have to emphasize the “starter kit” aspect of it and expand on its functionality. Although the kit offers the essentials such as movement, jumping, enemies with basic AI, health system, and a coin collectible all integrated with the physics system in Unity, any platforming game since the mid-90’s has offered more. Be it wall jumping, ground pounding, powerups, or even just swimming, these are all items that I eventually wanted to add to this starter kit.
Wall Kicks Will Work
I knew the logic behind how I wanted to approach this right from the start. Specifically I would use the ‘grab box’ already attached to the player (used to determine when the player can pick an item up) and if it was touching an object with the ‘Wall’ tag, it would let the player perform the wall jump. Being fairly new to C#, translating this logic to in to code proved to be quite intimidating at first. After combing through Google search results, most notably Unity Answers and forum posts, I dove in and began to implement the code. Line by line, the logic began to come together. The most difficult part was working with the rotation, specifically rotating the player 180 degrees after jumping off of the wall. Eventually I found the transform.RotateAround function which allowed me to do just that; rotating around the Vector3.up axis.