I am simply trying to get the linear velocity of a moving block in blender game engine and store it in a .py file. I am a beginner, however, and am having trouble doing this. Could someone please take a look at my script?
import PhysicsConstraints
import GameLogic
controller = GameLogic.getCurrentController()
senList = controller.sensors
actList = controller.actuators
r = senList["rightsensor"]
mr = actList["moveright"]
a = senList["always"]
outfile = open("velocitywrite.py", "w")
vel = controller.actuators["moveright"].getLinearVelocity()
if r.positive:
controller.activate(mr)
if a.positive:
outfile.write(vel)
Thanks sooo much,
amartin7211