일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- 최소제곱법
- 회귀
- 회귀학습
- Nonlinear Function
- Nonlinear Model
- Effective C++
- call by value
- inheritance
- 딥러닝
- Overloading
- call by reference
- c++
- overriding
- local minimum
- regression
- 지도학습
- Linear Regression
- struct
- Class
- Machine learning
- member function
- 머신러닝
- kubernetes
- 비선형 함수
- 맵리듀스
- 선형모델
- virtual function
- 비선형모델
- least square
- MapReduce
- Today
- Total
J's Study log
[Unity] Camera Work 본문
To make camera follow an object in Game View, you have to make a script and apply to Main Camera.
First you have to declare a member variable which type is GameObject. For example, when I declare the variable like this
By using it, you can input real object's location to 'ball' by 'GameObject.Find(" ");' command.
The location of object 'Ball' will be inputted to variable 'ball' when the game starts. By coding Update() function as picture
Highlighted transform.position calls the location of objects that this script is applied. 'new Vector3(x,y,z)' make a vector which have 'x,y,z' components. By substitution of 'ball.transform.position.y + 3' in 'y' value and 'ball.transform.position.z - 14' in 'z' value, Main Camera will follow the ball in the game.
'Computer Language > Unity' 카테고리의 다른 글
[Unity] Input keys (0) | 2019.02.25 |
---|---|
[Unity] Input Arrow Keys (0) | 2019.02.25 |
[Unity] GetComponent (0) | 2019.02.23 |
[Unity] Script (0) | 2019.02.23 |
[Unity] Physics Material (0) | 2019.02.21 |