Exemplo n.º 1
0
        // 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>();
        }
Exemplo n.º 2
0
        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>();
        }
Exemplo n.º 3
0
        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>();
            }
        }