Quick start guide for Havok Physics | Havok Physics for Unity | 0.1.2-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Quick start guide for Havok Physics

    This guide aims to get you up and running as quickly as possible with Havok Physics for Unity.

    The steps below make use of the Unity Physics Samples publicly available on GitHub (see the Unity Physics Samples documentation for more details).

    Adding the Havok Physics for Unity package

    1. Get the Unity Physics Samples if you don't already have them.
    2. Open the UnityPhysicsExample project
    3. Add the Havok Physics package..

      ..via Package Manager
      1. Open Unity's Package Manager from the Window > Package Manager menu item
      2. With All packages toggled, select and install Havok Physics. Note that the Install button is at the bottom right of the window.

        ..or via zip download
      3. If receiving the packages outside of the package manager unzip Havok.Physics.zip to desired package directory outside of the new clone directory e.g. D:\Packages\
      4. Locally modify the samples project's manifest to add this package as a dependency.
        "dependencies": { ... "com.havok.physics": "file:D:/Packages/Havok.Physics/com.havok.physics", ... }
    4. Ensure the Havok Physics plugin is installed by checking in the Packages subfolder.

    Change a scene to simulate with Havok Physics for Unity instead of Unity Physics

    1. Open the Pyramids test scene located in Assets\Tests\Pyramids.
    2. Press Play to simulate the scene using the stateless Unity Physics backend.
    3. Stop the simulation to reset the pyramid stack.
    4. Examine the Physics Scene Basic Elements node in the scene hierarchy.
    5. Select the Physics Settings node.
    6. In the inspector, change the Simulation Type of the Physics Step component from Unity Physics to Havok Physics.

      Note: the Simulation Type in the Physics Step component can also be toggled at runtime as well.
    7. Press Play to simulate the scene using the Havok Physics backend.
    8. In the Game tab use the left mouse button (LMB) to click and drag dynamic rigid bodies. Holding the right mouse button (RMB) activates mouse look and the 'ASWDQE' keys move the camera.
    9. Observe that the simulation is more stable than it was in Unity Physics, due to the use of simulation caches in Havok.Physics. This is just one example of how Havok produces a more realistic behavior.

    The Havok Physics simulation behavior can be further configured in any scene by using the Havok Configuration component. The simulation can also be analysed with the Visual Debugger.

    In This Article
    • Adding the Havok Physics for Unity package
    • Change a scene to simulate with Havok Physics for Unity instead of Unity Physics
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023