BabylonJS-CharacterController icon indicating copy to clipboard operation
BabylonJS-CharacterController copied to clipboard

support babylon v5

Open SapsayArtyom opened this issue 2 years ago • 4 comments

When will there be a Babylon.js 5.0 support?

SapsayArtyom avatar Apr 19 '22 16:04 SapsayArtyom

This should work with 5.0. Let me know if you run into any issues.

ssatguru avatar Apr 21 '22 23:04 ssatguru

I get error

ERROR in ./node_modules/babylonjs-charactercontroller/dist/CharacterController.js Module not found: Error: Can't resolve 'babylonjs' in 'D:\Harryk\my_project\study_babylon\node_modules\babylonjs-charactercontroller\dist' @ ./node_modules/babylonjs-charactercontroller/dist/CharacterController.js 1:85-105 @ ./src/index.ts @ multi babel-polyfill ./src/index.ts

but maybe because I connect Babylon in this way (it`s my index.ts)

import '@babylonjs/core/Debug/debugLayer'; import '@babylonjs/inspector'; import '@babylonjs/loaders/glTF'; import { Engine, Scene, Mesh, MeshBuilder, StandardMaterial, } from '@babylonjs/core'; import { CharacterController } from 'babylonjs-charactercontroller';

SapsayArtyom avatar Apr 22 '22 09:04 SapsayArtyom

Yes you are right. This is the same issue as the one reported here https://github.com/ssatguru/BabylonJS-CharacterController/issues/39

Currently CharacterController is using import .. from babylonjs ; instead of import ... from @babylonjs/....;

It is not using ES6 module. I have added using ES6 module to my TODO list but no ETA for now.

I suggest you either

  • switch to using babylonjs instead of @babylonjs/.. or
  • just copy CharacterController to your project and update it to use @babylonjs It is just one file , so that should be easy

ssatguru avatar Apr 22 '22 16:04 ssatguru

Posted an ES6 version in thread here: https://github.com/ssatguru/BabylonJS-CharacterController/issues/39

bigrig2212 avatar Nov 28 '22 01:11 bigrig2212