# Sample with HavokPlugin not working locally

**URL:** <https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037>\
**Category:** Bugs\
**Created:** [April 20, 2023, 6:14pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037 "2023-04-20T18:14:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cx20](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cx20/32/46_2.png) [@cx20](https://forum.babylonjs.com/u/cx20)\
**Post date:** [April 20, 2023, 6:14pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/1 "2023-04-20T18:14:49Z")

</div>

If you download the sample with HavokPlugin in zip format, it will not work locally.

> **[Babylon.js Playground](https://playground.babylonjs.com/#4Y813L%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/6/16849f57a7922eb35571f6429d6cd4a6a839896a.png)

```auto
Uncaught (in promise) ReferenceError: HavokPhysics is not defined
    at window.initFunction ((index):131:37)
    at (index):146:9

```

I think you probably need to add the following line to your index.html.

```auto
  <script src="https://cdn.babylonjs.com/havok/HavokPhysics_umd.js"></script> 

```

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 20, 2023, 6:35pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/2 "2023-04-20T18:35:04Z")

</div>

Thanks for reporting! We’ll fix this shortly 😃

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 20, 2023, 6:35pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/3 "2023-04-20T18:35:09Z")

</div>

Assigned @RaananW on April 20, 2023, 6:35pm UTC



---

<div class="post-metadata">

**Author:** ![cx20](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cx20/32/46_2.png) [@cx20](https://forum.babylonjs.com/u/cx20)\
**Post date:** [April 20, 2023, 6:53pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/4 "2023-04-20T18:53:56Z")

</div>

BTW, I think that it is necessary to describe the initialization process of `HK` in the migration document from V1.

> **[Migrate from Physics V1 | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/physics/migrate)**
>
> A guide on best practices to port a Physics V1 scene to V2

The zip downloaded from Babylon.js Playground contains the below process, otherwise you need to add it yourself.

```auto
globalThis.HK = await HavokPhysics();

```

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 20, 2023, 6:55pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/5 "2023-04-20T18:55:48Z")

</div>

Oh, that’s a good point! We’re merging the Playground download fix [add havok to download mode by RaananW · Pull Request #13764 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/13764) and we’ll update the docs too

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 20, 2023, 7:47pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/6 "2023-04-20T19:47:26Z")

</div>

Unassigned @RaananW on April 20, 2023, 7:47pm UTC



---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [April 20, 2023, 7:48pm UTC](https://forum.babylonjs.com/t/sample-with-havokplugin-not-working-locally/40037/7 "2023-04-20T19:48:28Z")

</div>

Should be good in 15-20 minutes. just make sure to clear your cache to be sure 🙂
