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