private void LateUpdate() { //Shifting all OSC data to late update for a smooth transition if (enableDamping == true) { damping = tmpOSC[1] * dampingMultiplier; OSC_channels.OSCch_data[channel, 0] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 0], tmpOSC[0], damping * Time.deltaTime); OSC_channels.OSCch_data[channel, 2] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 2], tmpOSC[2], damping * Time.deltaTime); OSC_channels.OSCch_data[channel, 3] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 3], tmpOSC[3], damping * Time.deltaTime); OSC_channels.OSCch_data[channel, 4] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 4], tmpOSC[4], damping * Time.deltaTime); OSC_channels.OSCch_data[channel, 5] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 5], tmpOSC[5], damping * Time.deltaTime); OSC_channels.OSCch_data[channel, 6] = MathS.LerpUnclamped(OSC_channels.OSCch_data[channel, 6], tmpOSC[6], damping * Time.deltaTime); } else { OSC_channels.OSCch_data[channel, 0] = tmpOSC[0]; OSC_channels.OSCch_data[channel, 1] = tmpOSC[1]; OSC_channels.OSCch_data[channel, 2] = tmpOSC[2]; OSC_channels.OSCch_data[channel, 3] = tmpOSC[3]; OSC_channels.OSCch_data[channel, 4] = tmpOSC[4]; OSC_channels.OSCch_data[channel, 5] = tmpOSC[5]; OSC_channels.OSCch_data[channel, 6] = tmpOSC[6]; } }
void LateUpdate() { RY = MathS.LerpUnclamped(tempY, (OSC_channels.OSCch_data[channel, audio_component] * speed + offset), damping * Time.deltaTime); if (continuousRotate == true) { RY = OSC_channels.OSCch_data[channel, audio_component] * speed; transform.Rotate(new Vector3(0, RY, 0)); } else { transform.localEulerAngles = new Vector3(0, RY, 0); } }