Browse Source

fixed remote player animation

master
JoshuaReason 5 years ago
parent
commit
4568ac4855
4 changed files with 30 additions and 1 deletions
  1. +6
    -1
      Assets/Scipts/PlayerControllers/RemotePlayer.cs
  2. +8
    -0
      Assets/Shaders.meta
  3. +8
    -0
      Assets/WorldAssets.meta
  4. +8
    -0
      Assets/WorldAssets/Models.meta

+ 6
- 1
Assets/Scipts/PlayerControllers/RemotePlayer.cs View File

@ -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;
}

+ 8
- 0
Assets/Shaders.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f87a054963b01dc4c8aa2e3ffedcca21
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/WorldAssets.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7da0e8d0a6415f944aa43dff57b38ae3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/WorldAssets/Models.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c207356b78ec8e8499bb6047218dd104
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save