Skip to content

Instantly share code, notes, and snippets.

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
You can’t perform that action at this time.