ย rb.velocity += speed * GameObject.FindWithTag("Player").transform.position;
ํ๋๊น ์ฐ์ฐ์๊ฐ ๋ฒกํฐ2์์ ๋ซํธํ๋ค๋๋ฐ ๋จธ์ง;;
ย rb.velocity += speed * GameObject.FindWithTag("Player").transform.position;
ํ๋๊น ์ฐ์ฐ์๊ฐ ๋ฒกํฐ2์์ ๋ซํธํ๋ค๋๋ฐ ๋จธ์ง;;
ํด๋น ๋๊ธ์ ์ญ์ ๋์์ต๋๋ค.
๊ทธ๋ฌ๋ค.. ๊ทผ๋ฐ์ด๊ฑฐ ์ด์์๋ฉด ์ด์ ๋๋์์ฌ๋ ์ฐ๋๊ฑด๋ฐ ์ ํ๋ ์ด์ด๋ชธ์ฒด๋ง๊ณ ์ ๋ ๊ฒ์ป๋๋ฐ ์ด์ํ๋ใ ๋ก ๋ ์๊ฐ๋๋ฐ ์๊ทธ๋ด๊น..
var bulletPos = transform.position; var playerPos = GameObject.FindWithTag("Player").transform.position; var dir = (playerPos - bulletPos).normalized; rb.velocity += speed * (Vector2)dir; ํ ์คํธ๋ ์ํด๋ดค์ง๋ง ์๋ฐ ๋๋์ผ๋ก ํด์ผํ ๋ฏ