1
This commit is contained in:
30
unity/Assets/Script/GameObject/Other/CameraMove.cs
Normal file
30
unity/Assets/Script/GameObject/Other/CameraMove.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraMove : MonoBehaviour
|
||||
{
|
||||
private Transform player;
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindGameObjectWithTag("Player").transform;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
//RaycastHit[] hits;
|
||||
|
||||
//hits = Physics.RaycastAll(ray, Mathf.Infinity, badMask);
|
||||
//for (int i = 0; i < hits.Length; i++)
|
||||
//{
|
||||
// Debug.Log(hits[i].collider.gameObject.name);
|
||||
//}
|
||||
//Debug.Log(hits.Length);
|
||||
|
||||
if (player!=null)
|
||||
{
|
||||
transform.position = new Vector3(player.position.x, player.position.y - 11, player.position.z);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user