Search code examples
pythonpython-3.xgame-engine

Ursina : change FirstPersonController controls


I'm trying to make a 3D game in Ursina. I managed to have a working FirstPersonController, but it is using WASD. I'm french, and thus have an AZERTY keyboard, which isn't really convenient... Do you know how I could change my controls to move the FirstPersonController ?

I'd also like to be able to use "special" buttons of my mouse. For exemple, the "forward" and "backward" ones, to sprint and jump !


Solution

  • The WSAD keys for movement are hard-coded in the FirstPersonController class' update() method. Overwriting that (by extending the class) didn't work for me so the easiest way would be running your own version of Ursina. That is, don't install it through pip but clone the Git repo, edit the code and install it via python setup.py, as described in the documentation.

    If you feel that this would be a useful feature, you could add an issue on Github.