Hi, im pretty new to python for BGE and i was wondering how I can record an objects local ‘y’ velocity and record it to a float property.
I have this so far but it does’nt work, so im guessing its probably completely wrong:eyebrowlift2:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
def main():
# get forward velocity
lin_speed = obj.linV
######################
own.get(“Velocity”) = lin_speed
This is attached to a python comtroller attached to a cube, which has a very simple movement system. The cube has a property called “Velocity” which I want to store the cube’s current velocity.