Forum

Setup character move keys

27 November 2015 15:41 #5395
Hi all,
What is the most simple way to apply move keys to a character, say, WASD keys that pressing them will move a sphere around the scene regardless of the camera.
I have a static camera (which I would like to keep static), a sphere which is a rigid body and also defined as a character and a plane with collision. the most simple scene in the world. (See image).
When running the 'fast preview' the sphere falls to the plane as expected, now I want to use the WASD keys to move it around.
Keep in mind that I'm a complete Newbie and I don't know anything and also that I'm not a coder so if there are copy+pasting code lines involved, please note which file exactly and where exactly I paste.
Thanks!
01 December 2015 16:00 #5455

Ответ на сообщение пользователя BigMouse
Hi all,
What is the most simple way to apply move keys to a character, say, WASD keys that pressing them will move a sphere around the scene regardless of the camera.
Hi.

I made a little example for you. You need extract it using our Project Manager and see load_cb function in app_dev/simple_move_keys/simple_move_key.js.

And, please, read the documentation about API, Physics for more information.

Blend4Web Team
kirill@blend4web.com
 
Please register or log in to leave a reply.