mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Fixed King Movement Caused By Other Players
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MLAPI;
|
||||
|
||||
public class KingMove : MonoBehaviour
|
||||
public class KingMove : NetworkBehaviour
|
||||
{
|
||||
public float speed = 240.0f;
|
||||
|
||||
@@ -33,6 +34,9 @@ public class KingMove : MonoBehaviour
|
||||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
float translation = Input.GetAxis("KingMove") * speed;
|
||||
|
||||
// Make it move 10 meters per second instead of 10 meters per frame...
|
||||
|
||||
Reference in New Issue
Block a user