// Start is called before the first frame update void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { characterController = player.GetComponentInChildren <CharacterController>(); smoothLocomotion = player.GetComponentInChildren <SmoothLocomotion>(); playerGravity = player.GetComponentInChildren <PlayerGravity>(); playerClimbing = player.GetComponentInChildren <PlayerClimbing>(); } else { Debug.Log("No player object found."); } audioSource = GetComponent <AudioSource>(); }
void Start() { characterController = GetComponentInChildren <CharacterController>(); smoothLocomotion = GetComponentInChildren <SmoothLocomotion>(); mainCamera = GameObject.FindGameObjectWithTag("MainCamera").transform; if (characterController) { _initialPosition = characterController.transform.position; } else { _initialPosition = transform.position; } playerClimbing = GetComponentInChildren <PlayerClimbing>(); }
void Start() { // Make sure Climbable is set to dual grab SecondaryGrabBehavior = OtherGrabBehavior.DualGrab; // Make sure we don't try tp keep this in our hand GrabPhysics = GrabPhysics.None; CanBeSnappedToSnapZone = false; TwoHandedDropBehavior = TwoHandedDropMechanic.None; // Disable Break Distance entirely if default from Grabbable was used if (BreakDistance == 1) { BreakDistance = 0; } if (player != null) { playerClimbing = player.gameObject.GetComponentInChildren <PlayerClimbing>(); } }