- Home /
Question by
SeanWink · Jul 07, 2017 at 06:59 PM ·
c#animationcameracamera-movementcamera-look
Having Trouble animating camera at start of game
I am trying to have it so that when the game starts my camera starts facing the player character then animates to the top down perspective. This is a top down endless runner type game. At the start the player is already moving on the z axis. I want the camera to transition from the front of the player to the top down perspective in an arc. Here is how I "think" it should look. But I need help finishing it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowCam : MonoBehaviour
{
private Transform lookAt;
private Vector3 startOffset;
private Transform camerasubject;
private float animationTransition = 0.0f;
private float animationDuration = 4.0f;
// Use this for initialization
void Start ()
{
CameraAnimation ();
lookAt = GameObject.FindGameObjectWithTag ("Player").transform;
startOffset = transform.position - lookAt.position;
}
// Update is called once per frame
void LateUpdate ()
{
transform.position = lookAt.position + startOffset ;
}
void CameraAnimation()
{
camerasubject= GameObject.FindGameObjectWithTag ("Player").transform;
// Get player position then move camera around it.
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity Editor Like Camera Script? 1 Answer
Rotation of the fps camera doesn't work in game when animated 0 Answers
How to make my Camera Controller look at target 0 Answers
Free camera look question 2 Answers