22 lines
453 B
C#
22 lines
453 B
C#
using UnityEngine;
|
|
|
|
namespace Scampz.GameJam.Assets.Scripts.Player
|
|
{
|
|
public class Player : MonoBehaviour
|
|
{
|
|
private Animator _animator;
|
|
|
|
private void Start()
|
|
{
|
|
_animator = GetComponent<Animator>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
var player = GameObject.FindGameObjectWithTag("Player");
|
|
var cc = player.GetComponent<CharacterController>();
|
|
_animator.SetFloat("Speed", cc.velocity.magnitude);
|
|
}
|
|
}
|
|
}
|