hello everyone,
I am really new to scripting and having some trouble getting this expression to work. I want to query the current velocityX Y and Z of a rigidbody and use that value to drive their respective formatted text nodes and update them every frame. I found this in the docs:
When you select a rigid body, the Attribute Editor shows the current X, Y, and Z component values for Velocity, Spin, Force, and Torque. You can also query these attributes in MEL commands or expressions by using the attribute names in the following table.
Example runtime expression print (velocityX + "
"); This displays the contents of velocityX in the Script Editor each frame.
whatever I tried so far has not given me any connection. running the script gives me an error (// Error: print (rigidBody1.velocityX + "
"); //
// Error: Line 1.29: Invalid use of Maya object “rigidBody1.velocityX”. // )
after reading up on this for about 4 hours I am going to get some sleep and try again tomorrow! have a good day everyone 