17 lines
351 B
C#
17 lines
351 B
C#
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);
|
|
}
|
|
}
|
|
|