From 4568ac4855f105172186387b50dec2b45ad9e1ec Mon Sep 17 00:00:00 2001 From: JoshuaReason Date: Sun, 27 Jan 2019 12:25:01 +1100 Subject: [PATCH] fixed remote player animation --- Assets/Scipts/PlayerControllers/RemotePlayer.cs | 7 ++++++- Assets/Shaders.meta | 8 ++++++++ Assets/WorldAssets.meta | 8 ++++++++ Assets/WorldAssets/Models.meta | 8 ++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Assets/Shaders.meta create mode 100644 Assets/WorldAssets.meta create mode 100644 Assets/WorldAssets/Models.meta diff --git a/Assets/Scipts/PlayerControllers/RemotePlayer.cs b/Assets/Scipts/PlayerControllers/RemotePlayer.cs index 9568427..6194b4d 100644 --- a/Assets/Scipts/PlayerControllers/RemotePlayer.cs +++ b/Assets/Scipts/PlayerControllers/RemotePlayer.cs @@ -9,6 +9,11 @@ public class RemotePlayer : Player { private float walkSpeed; private Vector3 lastPosition; + public void Start() + { + lastPosition = transform.position; + } + protected override void Update() { DoAnimation(); @@ -18,8 +23,8 @@ public class RemotePlayer : Player { private void DoAnimation() { - Debug.Log("Updating remote Animation"); Vector3 dir = lastPosition - transform.position; + lastPosition = transform.position; Animator.SetFloat("WalkSpeed", dir.magnitude); transform.forward = dir.normalized; } diff --git a/Assets/Shaders.meta b/Assets/Shaders.meta new file mode 100644 index 0000000..472bf46 --- /dev/null +++ b/Assets/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f87a054963b01dc4c8aa2e3ffedcca21 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WorldAssets.meta b/Assets/WorldAssets.meta new file mode 100644 index 0000000..b49880d --- /dev/null +++ b/Assets/WorldAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7da0e8d0a6415f944aa43dff57b38ae3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WorldAssets/Models.meta b/Assets/WorldAssets/Models.meta new file mode 100644 index 0000000..a4d7756 --- /dev/null +++ b/Assets/WorldAssets/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c207356b78ec8e8499bb6047218dd104 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: