반응형
//빈 오브젝트는 하나 생성하고 그안에 카메라를 넣고 빈오브젝트에 이 스크립트를 바인딩한다.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cameramovie : MonoBehaviour {
public GameObject ch; // 인스펙터 창에서 캐릭터를 여기에 조인한다.
void Start () {
transform.position = ch.transform.position; // 캐릭터 좌표를 카메라 좌표로 ..
}
// Update is called once per frame
void Update () {
transform.position = ch.transform.position;
}
}
반응형
'Programing > unity' 카테고리의 다른 글
unity,유니티 ,마우스 이동 좌우,방향으로 캐릭터 회전 (1) | 2017.02.25 |
---|---|
유니티,unity, CharacterController 를 이용한 캐릭터이동 (0) | 2017.02.25 |
유니티,unity,3d 캐릭터 클릭한 방향으로 회전하기 (0) | 2017.02.25 |
unity,유니티,3d 클릭시 이동,RaycastHit ,Raycast ,ScreenPointToRay (0) | 2017.02.25 |
유니티,unity, text 추가,텍스트 추가 (0) | 2017.02.24 |