Just released a new version of Character Controller for Babylonjs.
Summary of change
added support for both front and back facing characters/avatars
The previous controller expected the character mesh to be created and animated facing the negative z direction. In other words, in rest pose, the character was expected to be facing the negative z direction. Now it supports both front and back facing characters.
added support for top down/isometric kind of use cases.
The previous controller was good for third person or first person type of games.
It was 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. Now it supports both type of games.
added support to control character movement via script
Previously the character could only be moved via keyboard. Now it can be moved via script too. This makes it easy to add support for devices like touch joystick or āmove on mouse clickā or UI etc
Delighted to have helped, contributed and tested from all angles this rather complete project to move a character without physics while simulating it a bit.
I recommend this CharacterContoler which works well.
One feature suggestion would be to add optional or configurable easing on third-person camera moves. Iāve always found it quite jarring in third-person games when the camera tracks avatar orientation precisely and instantly rather than gently following with easing (like say a drone camera might in the real world). For FPS games I can understand the need for responsive, precise movement, but for many other use cases, especially for spectators rather than players, gentler movement is more enjoyable (less nausea inducing) IMHO
Ah yes, ok, yes that would be cool too. There is a camera like that in Babylon, the cameraFollow I think, but itās a freeCcamera, for the character you have to use an acrRortateCamera, but it must be able to do that too
On a side note, I used to really enjoy FPS games like DOOM, Quake, Half Life etc when I was a kid, but I bought DOOM Eternal recently ā¦ and it was too much for me. I think Iām getting too old for FPS games
Lol, yes thatās its name: FollowCamera. She has been around for a while. I used it once to try it, but on a character, it was very complicated, because it is not an arcRotateCamera. I suddenly dropped it.
@inteja A little camera lag is always welcome. Iāve also found that a camera that points directly at the character at all times to be a mite undesirable.
Very cool character movement demo. Thereās some combos missing Iād like to see (like run + backwards), very interested in the skele. Looks good.
Well after giving arcFollowCamera a try, this will create a bug because the folllow camera needs a target and CharacterControler already creates a target to follow. I think there is a conflict or something else. Anyway, it works well with a normal arcRotateCamera, so the camera acceleration and bounce effects have to be added directly in CharacterControler.
@withADoveInOneHand
About the missing combos
I debated with myself about that . Should there be a back run? What about side run?
Some character controller turns the character around on back key and turn them to side on strafe keys.
Maybe have another mode?
The mode I implemented is more like the āminecraftā kind of mode.
As far as skele is concerned you can find all the original blend files here
The mesh is from Mixamo. Forgot where I got the skeleton. SecondLife maybe. Animations are a mish mash. Some from here, some from there
Yeah backwards and strafe running were what I wanted to see. I like that āmodeā where the character just turns and runs the direction of the strafe, but I also like plain faster strafing/backstepping (itās very lifelike)ā¦ Actually a strafe-run before transitioning into āturn that direction and runā would probably be the ultimate. [like saunter-strafe into fast strafe into turn and run and sprint ;p]
Not sure. Iāve been rebuilding my project so Iāll be revisiting this soon. Itās definitely a fine balance that must be achieved between the camera and player movement.
My only gripe with this excellent demo is strafe and forward/back being exclusive.
Hi, is it possible to allow the character to move while in the air (eg, still have control, at the moment when you jump you canāt effect movement until you land)?