not really an answer since it doesn't work properly just yet. As the parent object gains speed the child objects rotates as it should - but as soon as I stop, the child object halts although the parent objects still has some velocity.
here's the code I use. Also, I should probably use a local velocity and avoid using the GetAxis little hack. Any ideas? Much appreciated!
var parentObject : GameObject;
function Update(){
var speed = parentObject.GetComponent(Rigidbody).velocity.magnitude* 0.5f;
var z=Input.GetAxis("Vertical")*5 *speed;
var childObjects = GameObject.FindGameObjectsWithTag("stuff");
for (var childObject in childObjects)
childObject.transform.Rotate(0,0,-z);
}
↧