baflink

ForgeExample_AuthoritativeControllerFloats.cs

Jul 7th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. using BeardedManStudios.Network;
  5.  
  6. public class ForgeExample_AuthoritativeControllerFloats : NetworkedMonoBehavior
  7. {
  8.  
  9.     [NetSync]
  10.     public float horizontal = 0.0f;
  11.  
  12.     [NetSync]
  13.     public float vertical = 0.0f;
  14.  
  15.     protected override void OwnerUpdate()
  16.     {
  17.         base.OwnerUpdate();
  18.  
  19.         horizontal = Input.GetAxis("Horizontal");
  20.         vertical = Input.GetAxis("Vertical");
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment