일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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++
- regression
- 회귀
- Class
- Machine learning
- 선형모델
- 비선형 함수
- call by value
- struct
- Nonlinear Model
- 딥러닝
- Overloading
- call by reference
- 머신러닝
- kubernetes
- local minimum
- virtual function
- 회귀학습
- Nonlinear Function
- 지도학습
- Linear Regression
- 비선형모델
- 맵리듀스
- least square
- MapReduce
- 최소제곱법
- overriding
- member function
- Effective C++
- inheritance
- Today
- Total
J's Study log
[Unity] Trigger and Collision 본문
Crush
When two objects crush on each other at least one object must have Rigidbody, and both of them must have Collider. And if only one object moves and crush the moving object must have Rigidbody.
Collision
Collision detects crush following physical operation. But you have to make sure that Rigidbody -> Kinematic is off.
OnCollisionEnter(Collision col) - Will happen when the object crush on the other.
OnCollisionStay(Collision col) - Will happen every frame until the object is crushing on the other.
OnCollisionExit(Collision col) - Will happen when the object finishes crushing on the other.
We use these functions like picture.
Trigger
Not like Collision, Trigger detect the crush not counting physical operation. In other words, when two object contacts each other they don't bounce and they just pass.
OnTriggerEnter(Collision col) - Will happen when the object crush on the other.
OnTriggerStay(Collision col) - Will happen every frame until the object is crushing on the other.
OnTriggerExit(Collision col) - Will happen when the object finishes crushing on the other.
The variable of Collision becomes parameter of the function, and by using 'col' you can control the crushed object.
'Computer Language > Unity' 카테고리의 다른 글
[Unity] Pubilc (0) | 2019.03.06 |
---|---|
[Unity] Tag / Applied Learning(Eating Coins, Game Manager) (0) | 2019.03.04 |
[Unity] Local Transform (0) | 2019.02.27 |
[Unity] Parents and Child Object (0) | 2019.02.27 |
[Unity] Input Mouse Button (0) | 2019.02.27 |