Initial commit
This commit is contained in:
16
Assets/Scripts/SimplePlayerMovement.cs
Normal file
16
Assets/Scripts/SimplePlayerMovement.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SimplePlayerMovement : MonoBehaviour
|
||||
{
|
||||
public float moveSpeed = 3f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
float h = Input.GetAxis("Horizontal");
|
||||
float v = Input.GetAxis("Vertical");
|
||||
|
||||
Vector3 direction = new Vector3(h, 0, v);
|
||||
transform.Translate(direction * moveSpeed * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user