private void Grab(GameObject currentGrabbingController, uint controllerIndex, GameObject target) { bodyPhysics.TogglePreventSnapToFloor(true); bodyPhysics.enableBodyCollisions = false; bodyPhysics.ToggleOnGround(false); isClimbing = true; climbingObject = target; grabbingController = currentGrabbingController; startControllerPosition = GetPosition(grabbingController.transform); startPosition = playArea.position; OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex, climbingObject)); }
private void Grab(GameObject currentGrabbingController, uint controllerIndex, GameObject target) { bodyPhysics.TogglePreventSnapToFloor(true); bodyPhysics.enableBodyCollisions = false; bodyPhysics.ToggleOnGround(false); isClimbing = true; climbingObject = target; grabbingController = currentGrabbingController; startControllerScaledLocalPosition = GetScaledLocalPosition(grabbingController.transform); startGrabPointLocalPosition = climbingObject.transform.InverseTransformPoint(grabbingController.transform.position); startPlayAreaWorldOffset = playArea.transform.position - grabbingController.transform.position; climbingObjectLastRotation = climbingObject.transform.rotation; useGrabbedObjectRotation = climbingObject.GetComponent <VRTK_ClimbableGrabAttach>().useObjectRotation; OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex, climbingObject)); }
private void Grab(GameObject currentGrabbingController, uint controllerIndex) { bodyPhysics.TogglePreventSnapToFloor(true); bodyPhysics.enableBodyCollisions = false; bodyPhysics.ToggleOnGround(false); prevVelocity = playArea.GetComponent <Rigidbody>().velocity / 5; isClimbing = true; grabbingController = currentGrabbingController; startControllerScaledLocalPosition = GetScaledLocalPosition(grabbingController.transform); startPlayAreaWorldOffset = playArea.transform.position - grabbingController.transform.position; startGrabPointWorldPosition = grabbingController.transform.position; startPlayerAreaPosition = playArea.transform.position; OnPlayerClimbStarted(SetPlayerClimbEvent(controllerIndex)); }