You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
468 B
21 lines
468 B
using UnityEngine;
|
|
|
|
namespace Mirror.Examples.Benchmark
|
|
{
|
|
public class PlayerMovement : NetworkBehaviour
|
|
{
|
|
public float speed = 5;
|
|
|
|
void Update()
|
|
{
|
|
if (!isLocalPlayer) return;
|
|
|
|
float h = Input.GetAxis("Horizontal");
|
|
float v = Input.GetAxis("Vertical");
|
|
|
|
Vector3 dir = new Vector3(h, 0, v);
|
|
transform.position += dir.normalized * (Time.deltaTime * speed);
|
|
}
|
|
}
|
|
}
|