float h= Input.GetAxis("Horizontal")* Time.deltaTime;
transform.Translate(Vector3.right* h* 100 *Time.deltaTime); //좌우.
float v= Input.GetAxis("Vertical")* Time.deltaTime;
transform.Translate(Vector3.up* h* 100 *Time.deltaTime); //위아래.
bool JumpB = true;
if(Input.GetKey (KeyCode.Space) && JumpB == true ){
rigidbody.velocity = Vector3.up * jump *Time.deltaTime; //위로 점프.
JumpB = false;
}
if(Input.GetKey (KeyCode.Space) && Time.time > nextfireQ){
nextfireQ = Time.time + firerateQ;
rigidbody.velocity = Vector3.up * jump *Time.deltaTime; //위로 점프.
}
[Unity] 자주쓰는 함수_(3) GUI, OnGUI, 3D Text (0) | 2023.07.19 |
---|---|
[Unity] 자주쓰는 함수_(2) 충돌 (0) | 2023.07.19 |
[Unity] MonoBehaviour Life Cycle (0) | 2023.07.19 |
[Unity] Unity 3D 최적화 하기 (0) | 2023.07.19 |
[Unity] 유니티 게임엔진의 탄생 (0) | 2023.07.19 |