if (rb.velocity = vector.zero){ }
์ด๋ ๊ฒํ๋๊น ์๋ผ๋๋ฐ ์ด์ผํด์ผํ?
ํด๋น ๋๊ธ์ ์ญ์ ๋์์ต๋๋ค.
๊ธธ์ด๊ฐ epsilon๋ณด๋ค ์์๋๋ก ํ๋ฉด ๋จ
ใณใณ
rb.velocity.sqrmagnitude <= 0.1f
Mathf.Approximately(rb.velocity.sqrMagnitude, 0.0f) == true
ํด๋น ๋๊ธ์ ์ญ์ ๋์์ต๋๋ค.
๊ธธ์ด๊ฐ epsilon๋ณด๋ค ์์๋๋ก ํ๋ฉด ๋จ
ใณใณ
rb.velocity.sqrmagnitude <= 0.1f
Mathf.Approximately(rb.velocity.sqrMagnitude, 0.0f) == true