Comments (6)
Got it working in es6 with straight javascript (versus typescript):
Here's the file: cc.js.zip
and then in my entry file i've got the following imports (some of these aren't needed just for character controller, but here you go anyway):
import { Engine } from '@babylonjs/core/Engines/engine'
import { Texture } from '@babylonjs/core/Materials/Textures/texture'
import { CubeTexture } from '@babylonjs/core/Materials/Textures/cubeTexture'
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial'
import { Vector3, Color3 } from '@babylonjs/core/Maths/math'
import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera'
import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight'
import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight'
import { CreateSphere } from "@babylonjs/core/Meshes/Builders/sphereBuilder";
import { CreateGround } from "@babylonjs/core/Meshes/Builders/groundBuilder";
import { CreateGroundFromHeightMap } from "@babylonjs/core/Meshes/Builders/groundBuilder";
import { CreateBox} from "@babylonjs/core/Meshes/Builders/boxBuilder"
import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator'
import { ShadowGeneratorSceneComponent } from '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent'
import { EnvironmentHelper } from '@babylonjs/core/Helpers/sceneHelpers'
import {CharacterController} from './cc'
import { SceneLoader } from "@babylonjs/core/Loading/sceneLoader"
import { GLTFLoader } from "@babylonjs/loaders/glTF/2.0/glTFLoader"```
from babylonjs-charactercontroller.
I would like to do that but not quite sure how.
Show me some code snippet as to how you would like to use and let me see if I can work something out
from babylonjs-charactercontroller.
Thanks for the replay @ssatguru
Basically, you just need to replace your BJS dependencies to ES6 module version
BJS ES6 Module
Then replace the import usage within your code
from babylonjs-charactercontroller.
What about users who are using the non es6 version of BABYLONJS ? Would I have to maintain a separate version for them?
from babylonjs-charactercontroller.
Yes, normally that is how it works. Two seperate repos.
BTW, do you have any existing project using this lib?
from babylonjs-charactercontroller.
Ok. This might take some time. I would suggest that for now just fork and use it. Its just one file. You can probably just add the source itself to your project.
Yes I do have a project which uses this. This was actually part of that project . I moved it out thinking it might be useful to others.
The project - https://github.com/ssatguru/Vishva.ts/tree/modularize
from babylonjs-charactercontroller.
Related Issues (20)
- pressing shift should make walkback ,strafeLeft/Right, turnLeft/Right faster HOT 1
- Avatar reflection? HOT 1
- testAnimationGroup from GLB not working HOT 7
- support babylon v5 HOT 4
- How to destroy? HOT 3
- updateTargetValue bug HOT 4
- What about pull requests awaiting review ? HOT 3
- PauseAnims() doesn't pause HOT 4
- Use characterController for secondary players HOT 9
- First person not working with glb avatars HOT 3
- moveWithCollision and calcMovePOV jitter HOT 3
- There was jitter when performing the Walkback and trunRight operations
- Work with Havok
- How can I change brightness of the avatars? HOT 2
- use raycast to detect slope,steps and ground
- Using Character Controller on Server HOT 1
- Problem with character mesh? controller?
- How can I copy an avatar and synchronize remotely?
- How cam I programmatically force an avatar to fallFall? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylonjs-charactercontroller.