protected override void InteractStart(IInteractor interactor) { var interactorGO = interactor.GetGameObject(); _followTransform = interactorGO.GetComponent <Transform>(); _followAgent = interactorGO.GetComponent <NavMeshAgent>(); _followAgent.speed /= slowFactor; }
protected override void InteractStart(IInteractor interactor) { _interactor = interactor; _grabber = interactor.GetGameObject().transform; _navObstacle.enabled = false; rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ; rigidbody.isKinematic = true; if (_interactor is PlayerInteractor playerInteractor) { playerInteractor .GetIkOverride() .SetGoal(AvatarIKGoal.RightHand, handle); } }
protected override void InteractStart(IInteractor interactor) { _interactor = interactor; _grabber = interactor.GetGameObject().GetComponent <Transform>(); // stop _rb.velocity = Vector3.zero; _rb.angularVelocity = Vector3.zero; // stay in place _rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; _rb.useGravity = false; // dont prevent player from walking _navObstacle.enabled = false; if (_interactor is PlayerInteractor playerInteractor) { var ik = playerInteractor.GetIkOverride(); ik.SetGoal(AvatarIKGoal.RightHand, handleRight); ik.SetGoal(AvatarIKGoal.LeftHand, handleLeft); } }