Hello, I am trying to use Matter JS on codepen, I firstly received the error that the variable Matter was not defined, I already fixed this but another error came.
Code Preview:
import * as Matter from: "https://cdn.skypack.dev/matter-js@0.16.0"; let engine = Matter.engine.create(); let render = Matter.render.create({ element: document.body, engine:engine }); // and some more code...
Preview: https://codepen.io/Eslare/pen/NWRQXpx
The Error: TypeError: undefined is not an object (evaluating 'Matter.engine.create')
Don't import it in your JS section, just go to the settings and add it as external script.
1.4m articles
1.4m replys
5 comments
57.0k users