Giter Site home page Giter Site logo

unidaystudio / upbge-charactercontroller Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 11.0 8.23 MB

This templates was created to help Blender Game Engine (UPBGE) users to create games or any kind of interactive things that requests a Character Controller. Easy to use, easy to attach to your project.

Python 100.00%

upbge-charactercontroller's People

Contributors

unidaystudio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

upbge-charactercontroller's Issues

Use SCA_InputEvent.active instead of SCA_InputEvent.values

if keyboard[bge.events.LEFTSHIFTKEY].values[-1]:

if keyTAP in keyboard[bge.events.SPACEKEY].queue:

SCA_InputEvent.values exists for keyboard events only because the mouse events need this field to store the mouse position or wheel rotation.

Also using the last item of values mean that item in the between are ignored, if the key is pressed and released and that a frame contain only these two actions, the last value will be 0 and you will miss the activation.

You should use the helpers:
https://pythonapi.upbge.org/bge.types.SCA_InputEvent.html#bge.types.SCA_InputEvent.active
https://pythonapi.upbge.org/bge.types.SCA_InputEvent.html#bge.types.SCA_InputEvent.inactive
https://pythonapi.upbge.org/bge.types.SCA_InputEvent.html#bge.types.SCA_InputEvent.activated
https://pythonapi.upbge.org/bge.types.SCA_InputEvent.html#bge.types.SCA_InputEvent.deactivated

if keyboard[bge.events.LEFTSHIFTKEY].values[-1]:
    speed = self.runSpeed
if keyboard[bge.events.LEFTSHIFTKEY].active:
    speed = self.runSpeed

multiplying a matrix by a vector?

I can see this is quite an old project, it may just be to do with changes to the API, but it's full of lines that throw errors
eg.
self.character.walkDirection = self.object.worldOrientation * vec

this is because "self.object.worldOrientation" is a Matrix and vec is a Vector

sorry if this is a basic question, I'm more familiar with Quaternions than matrices

what is it meant to be doing?
should "vec" be converted to a matrix? this would allow for multiplication which accumulates (like a Quat)

Broken link

Link to the youtube channel in the file readme.md is broken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.