SimpleMovement.cs 423 B

12345678910111213141516
  1. // MIT License
  2. // https://gitlab.com/ilnprj
  3. // Copyright (c) 2020 ilnprj
  4. using UnityEngine;
  5. public class SimpleMovement : MonoBehaviour
  6. {
  7. [SerializeField]
  8. private int speed = 10;
  9. public void FixedUpdate()
  10. {
  11. Vector3 Movement = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
  12. transform.Translate(Movement * speed * Time.fixedDeltaTime, Space.Self);
  13. }
  14. }