SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
545 B

4 years ago
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Movement : MonoBehaviour
  5. {
  6. public float speed = 4;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. }
  11. // Update is called once per frame
  12. void Update()
  13. {
  14. float h = Input.GetAxisRaw("Horizontal");
  15. float v = Input.GetAxisRaw("Vertical");
  16. gameObject.transform.position = new Vector3(transform.position.x + (h * speed),
  17. 0f, transform.position.z + (v * speed));
  18. }
  19. }