I need the local velocity of xy and Z for a rigid bodies sub objects

hey there.

I’m cutting my teeth on a small flying game, i have created a C# script for drag/lift for surfaces moving through air which works pretty well now i need to hook it up to a rigid body with surfaces as sub objects (wings, vertical and horizontal stabilisers) so i need to get the local velocities for these parts in x y and z, but I’m a bit stumped…if anyone could point me in the right direction of some possible solutions.

currently I’m wandering about converting the main objects velocity angles with the sub-objects transforms, but that won’t get the sub-objects velocity as well so i was wondering if there was a better way of doing it?

Cheers.

solved this one myself:

	public Transform [] surface;
	private Vector3 [] currentPos;
	private Vector3 [] lastPos;
        private Vector3 [] airVelocityVector;
	
for(int i = 0; i < surface.Length; i++)
		{
        //set curret positions
		currentPos _= surface*.position;*_

* //create air movement vector for each surface*
airVelocityVector = (currentPos - lastPos*) / Time.deltaTime;*

* //set last positions to current*
lastPos = currentPos*;*
}