void Start()
 {
     ropeLayer         = LayerMask.NameToLayer("RopeLayer");
     m_PSM             = GetComponent <scr_PSM>();
     currentlyClimbing = false;
     m_rgd             = GetComponent <Rigidbody>();
     m_capsuleCollider = GetComponent <CapsuleCollider>();
     m_movementScript  = GetComponent <scr_CharacterMovement>();
     currentlyAttached = false;
 }
    void Start()
    {
        SetCameraTarget(target);
        playerStateManager = GameObject.FindGameObjectWithTag("Player").GetComponent <scr_PSM>();
        // m_previousPlayerState = GameObject.FindGameObjectWithTag("Player").GetComponent<scr_PSM>();

        m_targetPos             = target.position + m_cameraPositionSettings.targetPosOffset;
        m_destination           = Quaternion.Euler(m_aimSettings.xRotation, m_aimSettings.yRotation + target.eulerAngles.y, 0) * -Vector3.forward * m_cameraPositionSettings.m_distanceFromTarget;
        m_destination          += m_targetPos;
        transform.position      = m_destination;
        m_DefaultCameraRotation = new Vector2(m_aimSettings.xRotation, m_aimSettings.yRotation);
    }
Beispiel #3
0
 void Start()
 {
     m_Animator                = GetComponent <Animator>();
     m_Rigidbody               = GetComponent <Rigidbody>();
     m_Capsule                 = GetComponent <CapsuleCollider>();
     m_CapsuleHeight           = m_Capsule.height;
     m_CapsuleCenter           = m_Capsule.center;
     m_Player                  = this.gameObject;
     m_Rigidbody.constraints   = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;
     m_OrigGroundCheckDistance = m_GroundCheckDistance;
     m_PSM          = GetComponent <scr_PSM>();
     m_AudioManager = Camera.main.GetComponent <scr_AudioManager>();
     m_defaultSlidingSpeedMultiplier = m_MoveSpeedMultiplier;
     m_defaultMovingTurnSpeed        = m_MovingTurnSpeed;
     m_TPUC = gameObject.GetComponent <scr_ThirdPersonUserControl>();
 }
    // Use this for initialization
    void Start()
    {
        m_targetRotation   = transform.rotation;
        playerStateManager = this.gameObject.GetComponent <scr_PSM>();
        m_cameraController = Camera.main.GetComponent <Scr_CameraController>();

        if (GetComponent <Rigidbody>())
        {
            m_rb = GetComponent <Rigidbody>();
        }
        else
        {
            Debug.LogError("The player needs a rigidbody");
        }
        forwardInput = 0; turnInput = 0; jumpInput = 0;
    }
Beispiel #5
0
    private void Start()
    {
        // get the transform of the main camera
        if (Camera.main != null)
        {
            m_Cam = Camera.main.transform;
            cam   = Camera.main.transform;
        }
        else
        {
            Debug.LogWarning(
                "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls.");
            // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them!
        }

        // get the third person character ( this should never be null due to require component )
        m_Character       = GetComponent <scr_ThirdPersonCharacter>();
        m_arrowSpawnpoint = GameObject.FindGameObjectWithTag("arrowSpawnPoint").transform;
        m_player          = GameObject.FindGameObjectWithTag("Player");
        m_rgd             = gameObject.GetComponent <Rigidbody>();
        m_audioManager    = Camera.main.GetComponent <scr_AudioManager>();
        m_psm             = m_player.GetComponent <scr_PSM>();
    }