unity
![[์ ๋ํฐ ๊ธฐ์ด] #2. ๋ฆฌ์ง๋ ๋ฐ๋ (RigidBody) ๊ธฐ๋ฅ ์ ๋ฆฌ](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FH5aQF%2Fbtq0unumiWT%2FHBs8zRhMrF8Hwx9JDwmLiK%2Fimg.png)
[์ ๋ํฐ ๊ธฐ์ด] #2. ๋ฆฌ์ง๋ ๋ฐ๋ (RigidBody) ๊ธฐ๋ฅ ์ ๋ฆฌ
์ค๋ ฅ ์ค์ - Use Gravity ์ค์ ์ฒดํฌ์ ์ ์ฉ - ์ค๋ ฅ ์๋ ์ค์ : [Edit] -> [Project Settings...] -> [Gravity]์ x, y, z์ถ ๊ฐ๊ฐ์ ํด๋นํ๋ ์ซ์๊ฐ ๊ฐ ์ถ์ ์ ์ฉ๋ ์ค๋ ฅ ์๋ ๋ฆฌ์ง๋ ๋ฐ๋(Rigidbody)์ ๊ฐ ํญ๋ชฉ ๊ธฐ๋ฅ - Mass : ์ง๋ - Drag : ๊ณต๊ธฐ ์ ํญ (0์ ์ฐ์ฃผ ๊ณต๊ฐ) ์ค๋ ฅ ์ ์ฉ์ Drag ์์น๊ฐ ๋์์๋ก ๋ฌผ์ฒด๊ฐ ์ฒ์ฒํ ๋จ์ด์ง - Angular Drag : ํ์ ๊ฐ์ ๋ํ ์ ํญ - Use Gravity : ๋ฌผ์ฒด์ ๋ํ ์ค๋ ฅ ์ ์ฉ ์ฌ๋ถ - Is Kinematic : ๋ฌผ๋ฆฌ ํจ๊ณผ ์๋ฉธ ์ ์ฉ ์ฌ๋ถ (์ฒดํฌ ์ ๋ฌผ๋ฆฌ ํจ๊ณผ X) - Interpolate : ์บ๋ฆญํฐ์ ์์ง์์ด ๋ถ์์ฐ์ค๋ฌ์ธ ๋ ์์ฐ์ค๋ฝ๊ฒ ์ฒ๋ฆฌํ๋๋ก ๋๋ ๋๊ตฌ โ Interpolate ..
[์ ๋ํฐ ๊ธฐ์ด] #1. ํธ๋์คํผ(transform) ์ปดํฌ๋ํธ ๊ธฐ๋ณธ ๋ฉ์๋ ์ฝ๋ ์ ๋ฆฌ (C#)
์ ๋ํฐ์์ ๋ํ์ ์ผ๋ก ๋ง์ด ์ฐ์ด๋ ํธ๋์คํผ์ ์ปดํฌ๋ํธ๋ฅผ ์ ๋ฆฌํด ๋ณด์์ต๋๋ค. ์ด ๊ธ์ ์ผ์ดํฐ ๋์ '์ ๋ํฐ ์ ๋ฌธ ๊ฐ์ข part 2 - ํธ๋์คํผ' ๊ฐ์๋ฅผ ๋ฐํ์ผ๋ก ์์ฑํ ๊ธ์ ๋๋ค. ๊ฐ์ ์์์ ๊ธ ์ ์ผ ํ๋จ์ ์ฐธ๊ณ ์ฉ์ผ๋ก ์ฌ๋ ค๋จ์ต๋๋ค. ์ค๋ธ์ ํธ ์ด๋ (๊ฐ ์ง์ ์์ , Translate) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test : MonoBehaviour { // Update is called once per frame void Update() { if(Input.GetKey(KeyCode.W)) { // Transform์ ํฌ์ง์ ๊ฐ ์ง์ ์์ this.transform.pos..