For some reason the getLinearVelocity() is not working… the way I want it to. I think it may be my this < this(): but idk…
# get the controller
cont = GameLogic.getCurrentController()
own = cont.getOwner()
# get the object actuator named act
actMotion = cont.getActuator("act")
# get velocity
speed = own.getLinearVelocity()
equal = 2
if speed > 1():
own.linv = equal
sqrt means square root, and pow means power (number, exponent). Square roots and powers are only basic algebra, not trig. and that’s just a simple formula, so don’t feel overwhelmed.
oh, well you should have mentioned the Y value part.
# get the controller
cont = GameLogic.getCurrentController()
own = cont.getOwner()
# get the object actuator named act
actMotion = cont.getActuator("act")
# get velocity
speed = own.getLinearVelocity()
equal = 2
if speed[1] > :
own.linv = equal
there. I changed speed to speed[1], and took away the parentheses, because that is not a function.