Newton 2D Overview
What is Newton 2D?
RetroDev.Newton2D is a developer-friendly wrapper for Unity’s 2D physics system. It provides clean, intuitive methods for common physics operations, making your code more readable and easier to maintain.
Get RetroDev.Newton2D here:
The Problem It Solves
Working with Unity’s Rigidbody2D often means:
- Writing the same physics code repeatedly
- Remembering exact method names and parameters
- Dealing with verbose API calls for simple operations
Before Newton 2D:
rigidbody2D.AddForce(direction.normalized * magnitude, ForceMode2D.Force);With Newton 2D:
Newton2D.ApplyForce(rigidbody2D, direction, magnitude);Key Features
Intuitive API
Methods are named the way you think about physics: Jump(), ApplyForce(), SetVelocity(). No more digging through documentation.
Cleaner Code
One-line operations mean less clutter and more focus on game logic. Your physics code becomes self-documenting.
No Performance Cost
Newton 2D is just a thin wrapper around Unity’s physics—there’s zero performance overhead.
Common Operations Covered
Everything from applying forces to managing constraints, Newton 2D handles the physics operations you use every day.
What Newton 2D Provides
Force & Movement:
- Apply forces in any direction
- Set velocity directly
- Simulate jumps with proper physics
Rotation & Torque:
- Apply torque for rotation
- Control angular velocity
- Manage rotational constraints
Damping & Drag:
- Apply linear damping for smooth deceleration
- Control angular damping for rotation
- Simulate air resistance and friction
Constraints:
- Freeze/unfreeze position axes
- Lock/unlock rotation
- Set constraints with clear parameters
When to Use Newton 2D
Perfect for:
- 2D platformers with character movement
- Top-down games with physics-based controls
- Puzzle games with physics objects
- Any 2D game using Unity’s physics system
You might not need it if:
- You’re not using Unity’s physics system
- You’re building a 3D game (use Newton 3D instead)
- You prefer working directly with Unity’s API
Design Philosophy
Newton 2D follows these principles:
- Human-Readable: Method names describe what they do, not how they do it
- Parameter Clarity: Parameters are ordered logically and have clear purposes
- No Hidden Magic: Each method does exactly what it says—no side effects
- Unity-Compatible: Works seamlessly with Unity’s existing physics system
Getting Started
Ready to simplify your 2D physics code? Check out the Quick Start guide to see Newton 2D in action.