Files
speckle-unity/Assets/Extra/PlayerMovement3D.cs
T
2021-01-05 16:03:37 +00:00

19 lines
356 B
C#

using UnityEngine;
public class PlayerMovement3D : MonoBehaviour
{
public float speed = 20;
private Vector3 motion;
private Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
motion = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
rb.velocity = motion * speed;
}
}