<commit_before>= Walking Character
:author:
:revnumber:
:revdate: 2016/03/17 20:48
:keywords: documentation, physics, input, animation, character, NPC, collision
:relfileprefix: ../../
:imagesdir: ../..
ifdef::env-github,env-browser[:outfilesuffix: .adoc]


In the <<jme3/beginner/hello_collision#,Hello Collision>> tutorial and the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java[TestQ3.java] code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by the BetterCharacterControl.

Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation controls, so you can press WASD to make the third-person character walk; and how to implement dragging the mouse to rotate.


[WARNING]
====
Some details on this page still need to be updated from old CharacterControl +++<abbr title="Application Programming Interface">API</abbr>+++ to BetterCharacterControl +++<abbr title="Application Programming Interface">API</abbr>+++.
====



== Sample Code

Several related code samples can be found here:

*  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java[TestPhysicsCharacter.java] (third-person view)<commit_msg>Removed admonition warning about BetterCharacterControl now that its fixed.<commit_after>= Walking Character
:author:
:revnumber:
:revdate: 2016/03/17 20:48
:keywords: documentation, physics, input, animation, character, NPC, collision
:relfileprefix: ../../
:imagesdir: ../..
ifdef::env-github,env-browser[:outfilesuffix: .adoc]


In the <<jme3/beginner/hello_collision#,Hello Collision>> tutorial and the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java[TestQ3.java] code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by the BetterCharacterControl.

Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation controls, so you can press WASD to make the third-person character walk; and how to implement dragging the mouse to rotate.


== Sample Code

Several related code samples can be found here:

*  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java[TestPhysicsCharacter.java] (third-person view)
{'fraction_non_alphanumeric': 0.095069173465768, 'fraction_numerical': 0.013479957431713374, 'mean_word_length': 5.497695852534562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6956628', 'n_tokens_mistral': 835, 'n_tokens_neox': 767, 'n_words': 279}