일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |
- regression
- kubernetes
- 비선형 함수
- overriding
- call by value
- 선형모델
- 맵리듀스
- Machine learning
- 지도학습
- Nonlinear Model
- 최소제곱법
- local minimum
- member function
- Overloading
- call by reference
- c++
- Class
- 딥러닝
- Nonlinear Function
- inheritance
- MapReduce
- least square
- virtual function
- 회귀
- 머신러닝
- struct
- 회귀학습
- Effective C++
- 비선형모델
- Linear Regression
- 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 |