void PlayBack() { rigidBody.isKinematic = true; int frame = Time.frameCount % bufferFrames; print ("Reading frame " + frame); transform.position = keyFrames [frame].position; transform.rotation = keyFrames [frame].rotation; }
// Update is called once per frame void Update() { if (CrossPlatformInputManager.GetButton("Fire1")) { recording = false; replaySystem.PlayBack(); } else { recording = true; replaySystem.Record(); } //if(recording){replaySystem.Record();} }