Esempio n. 1
0
    /// <summary>
    /// Update is called once per frame to update the position of the camera
    /// </summary>
    private void Update()
    {
        player = GameManager.instantiatedPlayer.transform.GetChild(0).gameObject;

        if (player == null)
        {
            Debug.Log("Player in FollowPlayer doesn't exist" + player);
        }
        else
        {
            //Debug.Log("PLayer in FollowPlayer does exist" + player);
        }

        transform.position = following.CalculateMovement(player.transform.position);
        transform.rotation = following.CalculateRotation(player.transform.rotation, transform.rotation);
    }