Hello,
- Added: a converted build for UPBGE (4-3-2019)
Let the user/player set his own key and mouse bindings.
How it works:
- On a press of a button the script listen to our keyboard and mouse, once we get an input we put it into the global dict.
- The global dict is used to save, load and use all the keybindings.
How to use:
- Hit K to open the keybindings menu.
- Click on a button to set a new key or mouse button.
- Hit save or the close button to save and close the menu
How to port it to your game:
- Import the empty from the main scene into your main scene.
- Import the keybindings scene into your blend file (file->append).
- Make sure you have keybindings.py and my_functions.py aswell.
- Go to keybindings.py and change the scene names at the top of the script
How to add more Buttons/keys:
- Select 1 button and the text object, duplicate it, change the property to your likings
- Now go to keybindings.py head to def default_keybindings(cont): and set the key there as well
- Done!
Key and mouse bindings in action: (showing older version, but you get the idea)
BGE:
key and mouse bindings.blend (689.4 KB)
(Ignore the last comment in the Readme, forgot to remove it)
UPBGE:
keybindings upbge.blend (785.6 KB)
if you need a ‘First Person View’ movement script attached to it (BGE/UPBGE):
if you need a ‘Third Person View’ movement script attached to it (BGE/UPBGE):
As always if you like it or gonna use it leave a reply/like, thanks!
Cotaks