FollowingPlayer

using UnityEngine;
using System.Collections;

public class FollowingPlayer : MonoBehaviour
{
  public float cameraHeight = 17.0f;
  public float cameraDistance = 17.0f;
    
  private Transform playerPosition;
  
  void Start()
  {
    playerPosition = GameObject.Find("Player").transform;
  }
  
  void LateUpdate( ) 
  {
    transform.position = playerPosition.position + 
      new Vector3(cameraDistance, cameraHeight,           -cameraDistance);
    transform.LookAt(playerPosition);
  }
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.77.153