Created
March 1, 2018 09:29
-
-
Save tsubaki/31aefb8972ce0cc6655e271780c144af to your computer and use it in GitHub Desktop.
カメラが対象を追跡する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class FollowCamera2D : MonoBehaviour { | |
[SerializeField] Transform target; | |
private Vector3 offset = new Vector3(0, 0, -10); | |
void LateUpdate () | |
{ | |
transform.localPosition = target.position + offset; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment