Coder Social home page Coder Social logo

babylonjs-charactercontroller's People

Contributors

dad72 avatar ssatguru avatar thebusted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babylonjs-charactercontroller's Issues

ie 11 issues

in ie 11 jump using space bar and movement using arrow keys don't work.
This is because the new version of controller uses key rather than keycode to capture keyevents.
ie returns "Spacebar" rather than " " (returned by other browsers) for space key press
Also internet Explorer, Edge (16 and earlier), and Firefox (36 and earlier) use "Left", "Right", "Up", and "Down" instead of "ArrowLeft", "ArrowRight", "ArrowUp", and "ArrowDown".

Add animations with new keyboard controls

Hi,
I tried your CharacterController which works rather well, but we can only add predefined animation (like walking, running, jumping ...)
Can we add other animations like: punch, kick, sit, push, pick up, pull. We are quite limited now, we can not do a fighting game for example.

It would be great to have other possibilities of animation and possibilities to add other keyboard commands.

This is the only limit I currently find

Thanks

support front facing animated characters

Currently the controller expects the character mesh to be created and animated facing the negative z direction. In other words in Rest Pose the character should be facing the negative z direction.

We should support character mesh facing the positive z direction too

How can I change brightness of the avatars?

Hi. Thanks for sharing this great controller.

I upgraded my previous controller version 0.1.0 to 0.4.3 with the avatars in the demo site opened.

I found that the avatars looked too dark (both Vincent, and Npc) in the demo site. They look almost black when I look at the shadowed side without lighting in my web site.

The avatars in the old version looked pretty bright and clearly visible from all directions even without light. It seems that something changed about the brightness of avatars in version 0.4.3 (or before it).

How can I change the brightness of the avatars? I don't use any mesh editor, and I hope that there is an easy way to change brightness of a loaded mesh.

Thanks in advance.

updateTargetValue bug

Hi,

There is a small bug in updateTargetValue.:

private _updateTargetValue() { //donot move camera if av is trying to clinb steps if (this._vMoveTot == 0) this._avatar.position.addToRef(this._cameraTarget, this._camera.target);

Something is missing when you want the avatar to look in one direction or another as well as the camera with a different beta and alpha and radius.
Currently, my character can be anywhere on the terrain (it works on load), but the rotation of the character cannot be changed on scene load, nor can the beta, alpha and radius of the camera.
If I save the position, rotation of the player and the camera, so that when the player reloads the game later, he finds the same position and rotation, it does not work. only the position is taken into account, but the player will always look in the same direction and the camera will have an alpha and beta and radius always the same.

put another way. If I want to rotate my character when loading the game, it does not work. If I make my camera with a beta, alpha, radius in one way, it is not taken into account. because the updateTargetValue function re-modifies my values. The character has a default rotation as well as the arcRotateCamera.

How to correct this? Thanks.

Use characterController for secondary players

Anyone using CC for secondary player control? ie: not the player attached to the camera. I want to do that, but looks like camera controls are entangled a bit. I'll work on separating it out - unless anyone has already done so - or if you have a quick tip SSatGuru?

Problem with character mesh? controller?

Hi!
Thanks for the cool asset first of all :)

I seem to have some problem integrating another model though.
https://sketchfab.com/3d-models/gorillamotions-b50cab2736c04d128f417f05008605fd

I tried the gltf, then converted it to .babylon but the same error: the root node is not a mesh.
I used the code from the demo scene to import the mesh and add the character controller.

however, when I check it out in babylon sandbox, I see that the root node is actually a mesh.

What may be the issue?

PauseAnims() doesn't pause

Hi all. I'm using pauseAnim() to play another animation (death animation).

All works fine - except that after the death animation is over, it reverts to the idle animation (but where none of the other animations will play). It does the same thing on Vincent model, so i dont think it's my GLB.

The only time it works is if i pause directly after doing cc.start(). Anytime later and it doesn't work.

I wonder, since pauseAnim only sets a property - does it need to do something more?

Mobile support

First off, I just wanted to say thanks for such a great, helpful repository! You rock!

Second, I was wondering what's the best way to tackle mobile support? I would love to be able to hold & drag my finger around the screen to walk, and pinch to zoom in/out. There's a good bablyonJS example here (load it on mobile to see what I mean): https://www.babylonjs.com/demos/sponza/

How can I implement such an option?

BabylonJS ES6 Module support

Hi there,

Really nice project, appreciate it. May I ask if my project is using BJS ES6 module, how can I get this lib to work without hard forking? Or is there any plan of adding BJS ES6 module support to this? Thank you in advance!!

Suggestions/ideas : CarControler

Hello,

I wonder if it would not be interesting to add a "CarControler" in the same spirit and complementary to the "CharacterControler" . Which would complete this library of controllable objects. Then we could talk about the "FlyControler", but that would be for later. It should be even simpler than the CarControler.
I explain in more detail the idea.

The CarControler :

  • Be able to play an animation to get into a vehicle and attach the character to the seat (parented the character to the seat for example) and detach the character animation.
  • The same thing to get out of a vehicle and detach the character and resume the animations of the character.
  • Play an animation to turn the steering wheel right and left (Which is enough).
  • A camera (The FollowCamera looks interesting here) that follows the vehicle with a position inside (close to the steering wheel) and another in the third person only which is fixed.
  • An animation for the wheels eventualy. I saw that animations on the wheel material which was less expensive (may be an idea to explore) This camera does not need to be rotated around the vehicle, but fixed to facilitate driving.
  • Sounds for the vehicle that accelerates, brakes, clack-sound, the collision too.
  • Moving, moving forward, backward, turning right and left. The movement of the acceleration must be progressive and we can very well imagine a function that would allow this acceleration power to vary depending on the vehicle (if it is heavy like the Transport truck, bus, normal like a standard car, fast , like a Porch, a Ferrari, racing car ...) In short, I find this function very useful to adapt the engine power in a way
  • Maybe you have ideas to add...

And without physics (type arcade like GTA doesIf you know this game)
The CharacterControler already has a good basis for making a CarControler. What do you think of the ideas?

I had idea to try to do it, but I have doubts, I think that it should remain in the same spirit as the CharacterControler and that it is to couple, so I ask you if you would be interested in doing it.

I am impatient to know what you think, your reactions, I would be very interested in this and I am sure that on the Babylon forum, many will find it great (I see a lot of little demos with cars)

I can then help you test it and give you feedback, improvements, bugs, help as best as I can. I think you have better programming skills than I do and I don't know much about typescript.

I may be able to help you find a 3D car model that would be used for testing, the final demo, unless you already have a 3D vehicle. Tell me how I can help you, don't hesitate.

Thanks in advance for reading me.

First person not working with glb avatars

In the testAnimationGroup example which uses a .glb avatar, when scrolling to go into first person mode, it stops right before. If in the same example I change to the .babylon, it works just fine. I've tried with other .glb avatars and same issue. I'm not sure what's different.

testAnimationGroup from GLB not working

Hi - just downloaded, npm installed and clicked "test animation group (using a .glb file)"
Character moves around, but does not change animation state (frozen state).
Haven't dived into it yet... but that's what i get on first install.
Works fine in .babylon format.

Thanks!!

Just a thanks for putting together this character controller. It's awesome! So much hard work and attention to detail on it. Planning to use it for a "movie maker" that i'm working on (slowly) at dfilm.com.

cheers,
ben

What about pull requests awaiting review ?

I see PRs that have not been validated for some time and have even become obsolete.

I have done 2 PRs recently awaiting review. Is the CharacterControler still maintained ?

Thanks

Multiple Jump and Reset animation

Hi,

  1. When you hold down the space bar, the jump is performed several times. Shouldn't it be done only once, even if you hold down the space key?

  2. In addition, if I press Z + Shift to run and release both keys at the same time, the character walks without any keys activate. The reset was not done completely

support top down/isometric kind of use case

The current controller is good for third party or first person type of games.
It is not suitable for top down or isometric kind of games where the camera follows but does not rotate the character or rotates when the character rotates.
We should support both use cases.

move character programmatically

currently, character can only be moved via keyboard.
we should provide methods to move character via code.
this would make it easy to add support for devices like touch joystick or move on mouse click etc

left right key should move left right rather than turn left right

Add two new sub modes.
In one sub-mode the left and right keys should make the avatar turn left or right and the back key makes the avatar walk backward with back facing the camera.
In the other sub-mode the left and right keys should make the avatar face and move left or right and the back keys makes the avatar turn around and move towards the camera.

Avatar reflection?

Trying character controller for the first time and attempting to merge it with the colyseus boilerplate (https://github.com/endel/colyseus-babylonjs-boilerplate)

I am seeing a reflection of the character as shown in the screenshot... I noticed this happens as soon as CharacterController.start(); is called.

Would appreciate any pointers to resolve this :)

Screen Shot 2022-02-09 at 6 18 24 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.