"SurfaceMagnetismBehavior is not a constructor"

@babylon/core 5.0.0 alpha 47

I got the latest alpha version yesterday on hopes of trying the new surface magnetism class.
I followed the docs, but, the dev. console kept saying the SurfaceMagnetismBehavior is not a constructor, so I checked, and indeed the class had no constructor.
I’m not sure, if I’m missing something here, or the docs are a bit off, in either case, I need your help :raised_hands:

SurfaceMagnetismBehaviour 5.0.0 alpha 47 on github

It is in the package, I am not sure why you are not finding it.

Actually it even is in the playground: Babylon.js Playground

1 Like

Okay, I think the problem is that I updated a project that was generated by BabylonJS Editor.

oh interesting, @julien-moreau might know ?

Hi @Gaandurian !

If you are using the editor and want to use the newest features coming from babylonjs v5, simply update all « @babylonjs » dependencies in your package.json and run again « npm i » to install/update the dependencies.

Once done all newly exported classes will be available in scripts :slight_smile:


For some reason this didn’t work, but for me, It wasn’t an issue because I was planning on starting fresh without the Bjs Editor anyway. (also, I only went back and tested this, after I had already switched to the new editor’less project, so I didn’t give it much time)

and, sorry for the late reply, wasn’t really around, and thank you for your answers

1 Like