-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use characterController for secondary players #64
Comments
I just added support for secondary player / npc . note that for such use cases, the CC mode will always be set to 1 Please try and let me know if you run into any issues. Ofcourse the other option is to create two cameras and assign the inactive camera to the seconday player. |
Hallo! Thx so much for the update. (missed the alert from github) Seems like there should be a method to send the rotation and keyUp , keyDown + modifiers? So that the actions of one player can be broadcast the others - and then those actions replicated on the secondary players? I started to play around with this: playerCCs[playerId].walk = true; Thought you might have a better idea for how it was supposed to work? (here's a visual showing what i'm doing for reference: syncing of one chars anim/pos to another player) |
see https://github.com/ssatguru/BabylonJS-CharacterController#controlling-avatar-programmatically so if you have two controllers cc1 and cc2 for player1 and player2 respt. as follows cc1 = new CharacterController(player1, null, scene); then to make player1 walk , do cc1.walk(true) to disable keypress from influencing 2nd player see https://github.com/ssatguru/BabylonJS-CharacterController#enablingdisabling-the-keyboard-controll |
K, i got it mostly working. Few things:
And that's a wrap. Great stuff. thx ssatGuru. |
it does not work.
it works.
a) fastRun. There is walk and there is run but there is no fastrun. So 'a' to walk , 'shift a' to run. There is no key combination for fastrun. So you can think of "walk-run" as "walk-fastwalk" or "run-runfast".
|
I have put in a fix for 1. also added test file for testing npc/secondary characters |
Nice. Keyboard fix works like a champ. Just being sure not to load two players in the same location, otherwise they get stuck to each other. |
I also set all of the positioning code to apply to player1 only - and the syncing works a lot better now. |
Hi again. Back to the missing anim functions. There are some anims that dont work for the secondary players. Like slideBack. I added a prototype for it.
And then call it like: But it doesnt trigger the anim for the 2ndary player. Doesn't error out anymore though. |
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?
The text was updated successfully, but these errors were encountered: