Hi all! I’ve been attempting to find out how to record the local x,y, and z velocities of an object using python, but unfortunately my searching has been fruitless. If you know, could you post the code please?
(Chances are it’s probably simple. Excuse my noobness :o).
‘Record’ in the sense of having variables that are equal to the local velocities of an object. For example:
x_velocity = [local x velocity of the object]
y_velocity = [local y velocity of the object]
z_velocity = [local z velocity of the object]
I’m getting closer. I modified a piece of code from a game resource, but it only records global velocities for the object. This doesn’t quite solve my problem.
import math
own = GameLogic.getCurrentController().owner
mult = 3
v = own.getVelocity()
x_velocity = v[0]
y_velocity = v[1]
z_velocity = v[2]
If anyone knows how to modify this code to record local velocity, it would be endlessly useful.
Cheers!