J's Study log

[Unity] Time.deltaTime 본문

Computer Language/Unity

[Unity] Time.deltaTime

정우섭 2019. 3. 6. 23:32

Time.deltaTime - Returns how long did the last frame took to complete, and it's unit is second.


We can use this mechanism like this


float timeCount = 0;

void Update()

{

timeCount += Time.deltaTime

if (timeCount > 3)

{

Debug.Log("Throw the stone");

timeCount = 0

}

.

.

.


We can print log every 3 seconds if we code like  this.

'Computer Language > Unity' 카테고리의 다른 글

[Unity] Prefab / Class Inheritance  (0) 2019.03.07
[Unity] UI  (0) 2019.03.06
[Unity] Pubilc  (0) 2019.03.06
[Unity] Tag / Applied Learning(Eating Coins, Game Manager)  (0) 2019.03.04
[Unity] Trigger and Collision  (0) 2019.03.02
Comments