Setup character move keys
27 November 2015 15:41
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!
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
Ответ на сообщение пользователя BigMouseHi.
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 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
kirill@blend4web.com