Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created March 1, 2018 09:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
カメラが対象を追跡する
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