I am getting this error when attaching a script to a root node in the editor. The node contains a mesh I have in the scene.
scene.js:3253 Uncaught TypeError: mesh.getTotalVertices is not a function
Steps:
- Drag Mesh ino Scene.
- Create TS file named playerCharacter in src/scenes/scripts/actors
- Attach Script to Mesh root node.
- Save Scene
- Run Scene
- Open in Browser
If a attach the same script to a dummy node the error doesn’t happen.
I am using WebGPU engine also.
Editor version 4.7.0.
My Package.json
{
"name": "babylonjs-editor-generated-template",
"version": "4.1.0",
"description": "Generated Template by BabylonJS Editor v4.1",
"scripts": {
"clean": "rimraf build declaration dist",
"compile": "tsc -p .",
"build": "webpack --mode production",
"watch": "webpack --mode development --watch",
"webserver": "http-server -p 1338 -c-1"
},
"license": "(Apache-2.0)",
"devDependencies": {
"@types/node": "17.0.0",
"@types/webpack": "5.28.0",
"typescript": "4.5.4",
"http-server": "0.12.1",
"webpack": "5.65.0",
"webpack-cli": "4.9.1",
"ts-loader": "9.2.6",
"raw-loader": "4.0.2",
"babel-loader": "8.2.3",
"babylonjs-editor-webpack-progress": "1.0.3"
},
"dependencies": {
"rimraf": "3.0.2",
"@babylonjs/core": "6.21.0",
"@babylonjs/loaders": "6.21.0",
"@babylonjs/materials": "6.21.0",
"@babylonjs/post-processes": "6.21.0",
"@babylonjs/procedural-textures": "6.21.0",
"@babylonjs/gui": "6.21.0",
"cannon": "0.6.2",
"earcut": "2.2.3"
}
}