how do I get an objects speed in the bge?
Its actual speed, not linear velocity. I want to create fall damage like in most games (minecraft for example)
how do I get an objects speed in the bge?
Its actual speed, not linear velocity. I want to create fall damage like in most games (minecraft for example)
linear velocity is just a big fancy word for speed. its in meters/frame
i think (or is it m/s? idk).
def printVelocity(controller):
object = controller.owner
velocityVector = object.getLinearVelocity()
velocityNumber = velocityVector.magnitude
print('object: %s | velocity: %.3d bu/s | vector: %s'
% (object.name, velocityNumber, velocityVector))
The linearVelocity
is in Blender Unit per Second.
I worked it out already. Even learned how to get the Z speed of an object all by playing around with Python itself!