FPS๋‚˜ ๋งˆ์ธํฌ๋ž˜ํ”„ํŠธ ์ฒ˜๋Ÿผ 1์ธ์นญ ์‹œ์ ์œผ๋กœ ๋‹ค๋‹ˆ๋Š” ๋ฐฉ๋ฒ•์ข€์š”

public class PlayerMove : MonoBehaviour

{

public float Speed;

Rigidbody rigid;

Vector3 moveVec;

void Awake()

{

rigid = GetComponent<Rigidbody>();

}

// Start is called before the first frame update

// Update is called once per frame

void FixedUpdate()

{

float h = Input.GetAxisRaw("Horizontal");

float v = Input.GetAxisRaw("Vertical");

//rigid.AddForce(new Vector3(h, 0, v), ForceMode.Impulse);

moveVec = new Vector3(h, 0, v).normalized;

transform.position += moveVec * Speed * Time.deltaTime;

transform.LookAt(transform.position + moveVec);

}

}

์œ„์—๊ป€ PlayerMove์ž…๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ๋งŒ๋“ค์—ˆ๋Š”๋ฐ ์•ž,๋’ค,์ขŒ,์šฐ ๋‹ค ๊ฐ€๊ธด ๊ฐ€๋Š”๋ฐ ๋ฌธ์ œ๋Š” ์ œ๊ฐ€ ์›ํ•œ ๋ฐฉ์‹์ด ์•„๋‹™๋‹ˆ๋‹ค. ๊ฒŒ์ฒ˜๋Ÿผ ์˜†์œผ๋กœ ๊ฑธ์„์ˆ˜๋„ ์•ž์„ ๋ณด๋ฉด์„œ ๋’ค๋กœ ๊ฑธ์„ ์ˆ˜๋„ ์—†์Šต๋‹ˆ๋‹ค.

FPS, ๋งˆํฌ ์ฒ˜๋Ÿผ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ์„ธ์š”. ์•„๋งˆ ์นด๋ฉ”๋ผ ์ฝ”๋“œ ์งœ์„œ ๋งˆ์šฐ์Šค ์›€์ง์ด๋Š” ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ์›€์ง์ด๊ฒŒ ํ•ด์ฃผ์„ธ์š”