Make games that matter
Physics solutions help you give weight to the elements of your game. Whether you’re building in 2D or 3D, a first-person camera or a side-scroller, your characters and objects can react realistically to the game world around them.
Unity’s physics solution for Entity-Component-System (ECS)-based projects consists of two offerings: Unity Physics and Havok Physics for Unity. Both are based on Unity’s ECS framework, sharing the same data protocol.
Using the same protocol allows you to transition your projects between these two physics systems without having to rebuild your content or game code. Whether you’re using Unity Physics or Havok Physics, the unified data protocol allows you to author once and simulate using any ECS-based physics engine.
Fast. Light. Stateless. Customizable. These are the qualities that drive our new Unity Physics solution.
Built on top of Unity’s ECS framework, it’s network-ready, completely customizable, and built for performance out of the box. Whether you’re building a mobile game or a new networked multiplayer console experience, Unity Physics leverages the Burst compiler and Job system to scale across a range of hardware.
Unity Physics is available with Unity 2022.2 Tech Stream and accessible via the Package Manager.
Havok Physics for Unity
Havok Physics for Unity raises the bar of your physics implementation with seamless integration for ECS-based projects. While Unity Physics is optimized for most real-time 3D use cases, Havok Physics for Unity can elevate the stability and performance of physics in spacious open worlds or in scenes with a massive number of rigid bodies. The Havok Physics for Unity simulation backend can be swapped with the Unity Physics backend easily at any time without needing to change existing physics assets or code.
Havok Physics for Unity is available with Unity 2022.2 Tech Stream.
If you’re working on an object-oriented project, there are two built-in physics engines to consider that cover both 3D and 2D game development.
Built-in 3D physics: NVIDIA PhysX integration
Unity’s built-in 3D physics engine is an integration of the PhysX engine in close partnership with NVIDIA. PhysX is available directly through the Editor.
NVIDIA PhysX SDK is an open source, scalable real-time physics engine that enables advanced simulations for more immersive game play with true-to-life simulations and real-time dynamic effects. PhysX is a library for representing 3D worlds that lets you create and destroy actors and tracks their explicit or proximity-based interactions.
PhysX SDK’s dynamics simulation capability includes support for collision, joints, and actuation using maximal and/or reduced coordinates. You can also query the world using a number of different tools, ranging from simple ray casts to sweep and overlap tests.
Built-in physics for 2D games
Unity comes with dedicated and optimized 2D physics, with many more features and optimizations to power your game.
2D Colliders enable accurate detection of your sprites’ shapes, from primitive to custom shapes. If they also include a Rigidbody 2D, the objects will react to gravity and behave as solid objects.
Objects anchored to another object also can benefit from physics with 2D Joints, adding realism to a sliding platform, chain, spring, or car. To simulate buoyancy or magnets, 2D Effectors can add non-contact physics effects.
DOTS physics samples
To help you get started, this repository of examples demonstrates how to take advantage of Physics in DOTS. Unity Physics samples are included in our ECS samples on GitHub.
Havok at GDC
Discover the architecture and features of Unity Physics, see it in action, and learn how Unity Physics and Havok Physics can work together to maximize dynamism in your games.
Join the discussion
Detail your requirements, offer feedback, and have candid discussions about physics. Share any issues you encounter with the new ECS-based physics systems in the forums.
The Unity and Havok partnership
Havok and Unity sat down for an interview to share how we partnered to create Havok Physics for Unity on top of Unity’s ECS framework.
Determinism is about getting the same outcome in a physical simulation when it is given the same set of inputs. Both Unity Physics and Havok Physics provide deterministic results. However, because different CPU architectures (x86, ARM, etc.) produce minor differences in their mathematical calculations, the deterministic results of the simulation may be different on different hardware.
Because Burst will solve the problem of cross-architecture determinism later this year, Unity Physics will automatically benefit from this feature as well, meaning that the simulation would be the same on any device.
Note: For single-architecture determinism, Unity Physics will require an upcoming Burst update.
Most physics engines, including Havok, achieve performance and stability with intelligent optimizations, such as caching parts of the world state in order to bypass or stabilize different calculations. Stateless physics instead achieves performance through brute force optimizations. Because of this, and because future versions of Burst will be able to execute across multiple architectures, it can benefit several different networked scenarios. On the other hand, there are some scenarios where Havok can achieve greater performance and stability.
Because stateless physics will be able to execute deterministically across multiple CPU architectures in future versions of Burst, it will be ready and easy to use for a variety of networking setups, including client-side prediction (e.g., FPS), lock-step client simulation (e.g., RTS), as well as GGPO/rollback (e.g., fighting games).
Because Havok Physics caches different state information to perform intelligent optimizations, it can achieve superior performance in large-scale games or games that use complex physics systems. Havok Physics also offers greater stability in handling interpenetrating objects and stacking bodies. Behavior will also be improved due to an advanced friction model that requires caches.
Both Havok Physics and Unity Physics use the same data model in the Unity editor. You can author content in a single way, and opt into either or both physics back ends, depending on the specific needs of your game or subsets of your game worlds.
No. Both Havok Physics and Unity Physics are opt-in packages based on DOTS. No existing content will break, though you may need to retune your existing content if you migrate to one of the new back ends.