you can multiply by the axis you want from the orientation matrix to get/set the local motion
lessee if I can do this off the top of my head:
return sqrt(A*A+A*A+A*A) #replace the 5 spaces in this line with a tab
#organize orientation matrix into a more convenient form
#get speed vectors along each local axis
#get local speed magnitudes
theoretically, if I’m not being retarded right now, this should spit out your object’s local speed in a few different formats (speed vectors along each axis, as well as their magnitudes- the naming should be clear enough). if it doesn’t work, or works wrong, tell me and I (or someone else) might be able to fix it… hopefully this at least will give you a starting point though.