Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Player : MonoBehaviour
- {
- [SerializeField] private float speed;
- [SerializeField] private float horizontalInput;
- [SerializeField] private float verticalInput;
- // Start is called before the first frame update
- void Start()
- {
- }
- void Update()
- {
- horizontalInput = Input.GetAxis("Horizontal");
- verticalInput = Input.GetAxis("Vertical");
- // new vector3(-1,0,0) * 5 * real time
- transform.Translate(new Vector3(horizontalInput,verticalInput,0) * speed * Time.deltaTime);
- }
- }
- /* Games With Wolverine */
- /* Thankyou Baccho */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement