void FixedUpdate() { foreach (GameObject recordable in recordables) { BallsBehaviour bb = recordable.GetComponent <BallsBehaviour>(); Rigidbody rb = recordable.GetComponent <Rigidbody>(); writer.WriteLine(bb.transform.position.x + "," + bb.transform.position.y + "," + bb.transform.position.z + "," + rb.velocity.x + "," + rb.velocity.y + "," + rb.velocity.z + "," + bb.color); writer.Flush(); } }
// Use this for initialization void Start() { // Find BallsBehaviour type component from parent gameobject ballParent = this.GetComponentInParent <BallsBehaviour> (); }