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