Players now move unsynced
This commit is contained in:
parent
c590bc893f
commit
8a3c164169
|
@ -728,67 +728,6 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
--- !u!1001 &820004546
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
serializedVersion: 3
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 320690117028550720, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 1294282455099768770, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: GlobalObjectIdHash
|
|
||||||
value: 686008210
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 3120938410244321186, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: NetworkedPlayer
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_RemovedGameObjects: []
|
|
||||||
m_AddedGameObjects: []
|
|
||||||
m_AddedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 29c8b8bbcf7287b4eb597729b2e0c9f9, type: 3}
|
|
||||||
--- !u!1 &941230147
|
--- !u!1 &941230147
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -4826,4 +4765,3 @@ SceneRoots:
|
||||||
- {fileID: 1481267923}
|
- {fileID: 1481267923}
|
||||||
- {fileID: 65889293}
|
- {fileID: 65889293}
|
||||||
- {fileID: 652688745}
|
- {fileID: 652688745}
|
||||||
- {fileID: 820004546}
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class ZDisablerV2 : NetworkBehaviour
|
||||||
[Tooltip("Add all the objects to disable on join, if not owner")]
|
[Tooltip("Add all the objects to disable on join, if not owner")]
|
||||||
public UnityEngine.Object[] objectsToDisable;
|
public UnityEngine.Object[] objectsToDisable;
|
||||||
|
|
||||||
private void OnEnable()
|
public override void OnNetworkSpawn()
|
||||||
{
|
{
|
||||||
// Run if networked
|
// Run if networked
|
||||||
if (NetworkManager.Singleton == null || IsOwner) return;
|
if (NetworkManager.Singleton == null || IsOwner) return;
|
||||||
|
|
|
@ -32,48 +32,12 @@ public class PlayerInput : MonoBehaviour
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
// check in update to switch if controller is connected/disconnected mid game
|
movement.x = Input.GetAxisRaw("bruh");
|
||||||
controller = Gamepad.all.ElementAtOrDefault(playerNumber);
|
movement.y = Input.GetAxisRaw("bruh_v");
|
||||||
|
|
||||||
if (controller != null)
|
whipAttack = Input.GetKey(KeyCode.R);
|
||||||
{
|
|
||||||
movement.x = controller.leftStick.x.ReadValue();
|
|
||||||
movement.y = controller.leftStick.y.ReadValue();
|
|
||||||
|
|
||||||
look.x = controller.rightStick.x.ReadValue();
|
if (Input.GetKey(KeyCode.E)) ropeLengthShrinken?.Invoke(playerNumber);
|
||||||
look.y = controller.rightStick.y.ReadValue();
|
if (Input.GetKey(KeyCode.Q)) ropeLengthExtend?.Invoke(playerNumber);
|
||||||
|
|
||||||
whipAttack = controller.buttonWest.IsPressed();
|
|
||||||
|
|
||||||
if (controller.rightShoulder.IsPressed()) ropeLengthShrinken?.Invoke(playerNumber);
|
|
||||||
if (controller.leftShoulder.IsPressed()) ropeLengthExtend?.Invoke(playerNumber);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// wasd
|
|
||||||
if (!useArrowKeys)
|
|
||||||
{
|
|
||||||
movement.x = Input.GetAxisRaw("bruh");
|
|
||||||
movement.y = Input.GetAxisRaw("bruh_v");
|
|
||||||
|
|
||||||
whipAttack = Input.GetKey(KeyCode.R);
|
|
||||||
|
|
||||||
if (Input.GetKey(KeyCode.E)) ropeLengthShrinken?.Invoke(playerNumber);
|
|
||||||
if (Input.GetKey(KeyCode.Q)) ropeLengthExtend?.Invoke(playerNumber);
|
|
||||||
}
|
|
||||||
// arrows keys
|
|
||||||
else
|
|
||||||
{
|
|
||||||
movement.x = Input.GetAxisRaw("bruh2");
|
|
||||||
movement.y = Input.GetAxisRaw("bruh2_v");
|
|
||||||
|
|
||||||
whipAttack = Input.GetKey(KeyCode.L);
|
|
||||||
|
|
||||||
if (Input.GetKey(KeyCode.Comma)) ropeLengthShrinken?.Invoke(playerNumber);
|
|
||||||
if (Input.GetKey(KeyCode.Period)) ropeLengthExtend?.Invoke(playerNumber);
|
|
||||||
|
|
||||||
}
|
|
||||||
//Debug.Log($"player {playerNumber}: move {movement}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,6 +364,7 @@ public class RopeSimulator : MonoBehaviour
|
||||||
|
|
||||||
private void OnDrawGizmos()
|
private void OnDrawGizmos()
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
if (!Application.isPlaying) return;
|
if (!Application.isPlaying) return;
|
||||||
|
|
||||||
foreach (var point in rope.points)
|
foreach (var point in rope.points)
|
||||||
|
|
Loading…
Reference in New Issue