mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-28 13:24:07 -05:00
Fixed King Movement Caused By Other Players
This commit is contained in:
@@ -153,7 +153,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3173415395305450996}
|
||||
m_Enabled: 0
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3}
|
||||
m_Name:
|
||||
|
||||
@@ -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