DevLog: Week 12 Physics and Control

In the penultimate week of the bootcamp, the focus shifted to the Unity Physics Engine and the creative manipulation of rigidbodies and forces. While previous weeks dealt with 3D space, this week was dedicated to the 2D environment, where physics logic is often more exposed and requires tighter mathematical control to feel "right."

The goal was to move beyond the default "out-of-the-box" settings to engineer custom, responsive control schemes.

Technical Highlights:

  • Rigidbody2D & Force Manipulation: I experimented with the different "Body Types" (Dynamic, Kinematic, and Static) to see how they interact under various constraints. By utilizing AddForce and Velocity manipulation in FixedUpdate, I moved away from simple coordinate translation and toward physics-based movement.

  • Custom Control Schemes: I explored non-traditional movement mechanics, such as:

    • Variable Jump Heights: Implementing gravity scaling so the jump height is determined by how long the player holds the input.

    • Momentum & Friction: Adjusting PhysicsMaterial2D properties like bounciness and friction to create "Slippery" or "High-Traction" surfaces, directly affecting the game’s difficulty and feel.

  • Collision Detection & Layers: I deepened my use of Layer Collision Matrices to optimize performance. By ensuring the engine only calculates collisions between relevant layers (e.g., Player vs. Ground, but not Player vs. Background), I’m practicing the "performance-first" mindset required in professional 2D development.

  • 2D Constraints: Using Rigidbody Constraints (Freezing Rotation) to prevent unintended physics behavior, ensuring the character controller remains upright and predictable while interacting with 2D physics objects like crates or moving platforms.

Reflection: The "Feel" of the Physics

Working in 2D highlighted just how much "game feel" depends on the fine-tuning of physics variables. Small changes in Linear Drag or Gravity Scale can be the difference between a character feeling "floaty" or "heavy." This week allowed me to bridge the gap between pure C# logic and the tactile, physical feedback that makes a game satisfying to play.

Previous
Previous

DevLog: Week 13 2D Arcade

Next
Next

DevLog: Week 11 Randomness and AI