์˜ค๋ธŒ์ ํŠธ๋ฅผ x๋กœ 10 ๊ฐ„ํ›„์— y๋กœ 10๋งŒํผ ๊ฐ€๊ณ ์‹ถ์€๋ฐย 


public class NewBehaviourScript : MonoBehaviour

{


ย  ย  Vector3 vec = new Vector3(10, 0, 0);

ย  ย 


ย  ย void Update()

ย  ย  {


ย  ย  ย  ย  transform.position = Vector3.MoveTowards(transform.position, vec, 0.1f);

ย  ย  ย  ย  transform.position = Vector3.MoveTowards(transform.position, new Vector3(0, 10, 0), 0.1f);


ย  ย  }

}

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด x๋กœ 10 ๊ฐ„ํ›„ y๋กœ 10 ๊ฐ€๋Š”๊ฒŒ์•„๋‹ˆ๋ผ x+y๋กœ ๊ฐ€๋ฒ„๋ฆฌ๋„ค,,, y๋กœ ๊ฐ€๋Š”๊ฑฐ๋ฅผ LateUpdate์— ๋„ฃ์–ด๋ณด๋ฉด ๋˜์ง€์•Š์„๊นŒ ํ–ˆ์—ˆ๋Š”๋ฐ ์ด๊ฑฐ๋„ ์•ˆ๋˜๊ณต

์–ด๋–ป๊ฒŒ ํ•ด์•ผ๋ ๊นŒ??