protected virtual void FixedUpdateAttached() { float distance = Vector3.Distance(AttachedPoint.transform.position, transform.position); if (distance > DropDistance) { Detach(); } else { AttachedPoint.PullTowards(this); } }
protected virtual void OnTriggerStay(Collider col) { if (IsAttached == false) { NVRAttachPoint point = AttachPointMapper.GetAttachPoint(col); if (point != null && point.IsAttached == false) { float distance = Vector3.Distance(point.transform.position, transform.position); if (distance < AttachRange) { Attach(point); } else { point.PullTowards(this); } } } }
protected virtual void OnTriggerStay(Collider col) { if (IsAttached == false && CanAttach == true) { NVRAttachPoint point = AttachPointMapper.GetAttachPoint(col); if (point != null && point.IsAttached == false) { float distance = Vector3.Distance(point.transform.position, this.transform.position); if (distance < AttachRange) { Attach(point); } else { point.PullTowards(this); } IsTryingToAttach = true; TryingToAttachItem = col.gameObject.GetComponentInParent <NVRInteractableItem> (); } } }