Unity Input 기능 정리


대충 이런것들

1
2
3
4
5
6
7
8
9
if(Input.GetKeyDown(KeyCode.Space)) // 하싶은거
if(Input.GetMouseButtonDown(0)) // 왼쪽클릭0번

float mouseX = Input.GetAxis("Mouse X");
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
        
transform.Translate((new Vector3(h, 0, v) * moveSpeed * Time.deltaTime)); //이동
transform.Rotate(new Vector3(0, mouseX, 0* 80 * Time.deltaTime)); //회전
cs

레퍼런스 보면 잘 나와있음.


반응형