void Update() { wandLeft.UpdateDrag(); wandRight.UpdateDrag(); bool left = wandLeft.interacting && wandLeft.gameObject.activeSelf; bool right = wandRight.interacting && wandRight.gameObject.activeSelf; bool left_T = wandLeft.thumbPress && wandLeft.gameObject.activeSelf; bool right_T = wandRight.thumbPress && wandRight.gameObject.activeSelf; if (left && right) { Vector3 prevDir = wandLeft.prevPos - wandRight.prevPos; Vector3 currDir = wandLeft.transform.position - wandRight.transform.position; prevDir.y = 0; currDir.y = 0; Quaternion rotation = Quaternion.FromToRotation(currDir, prevDir); float angle; Vector3 axis; rotation.ToAngleAxis(out angle, out axis); manipulatedTransform.RotateAround((wandLeft.transform.position * 0.5f + wandRight.transform.position * 0.5f), axis, angle); Vector3 delta = wandRight.deltaPos; delta.y = 0; manipulatedTransform.position -= (delta * 0.5f + delta * 0.5f); } else if (left ^ right) { WandController wand = (left) ? wandLeft : wandRight; Vector3 delta = wandRight.deltaPos; delta.y = 0; manipulatedTransform.position -= delta; //Debug.Log(left + " " + right); //Debug.Log(wand.deltaPos*10000); } else if (left_T && right_T) { manipulatedTransform.position = Vector3.Slerp(manipulatedTransform.position, startPosition, Time.time * slerpBackSpeed); manipulatedTransform.rotation = Quaternion.Slerp(manipulatedTransform.rotation, startRotation, Time.time * slerpBackSpeed); } else if (setToReview) { SetToReview(); setToReview = false; } else if (reset) { Reset(); reset = false; } wandLeft.SavePos(); wandRight.SavePos(); }