Attempt to get animation working

This commit is contained in:
2022-08-18 00:25:22 -07:00
parent bc8092d454
commit bc3b1b9df5
5 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
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);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d14f1a4437a41724c91591bb70a63248
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: