Luca Wey c7940aa8ea Revert "Musik Anderswelt & Effekte"
This reverts commit 574b404c2db3de8f6612460326a6881ac85c9f61
2023-06-07 11:42:40 +02:00

28 lines
527 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IsMovingTester : MonoBehaviour
{
private Animator animator;
private Rigidbody2D rb;
void Start()
{
animator = GetComponent<Animator>();
rb = GetComponent<Rigidbody2D>();
}
void Update()
{
if (rb.velocity.magnitude > 0.1f)
{
animator.SetBool("IsMoving", true);
}
else
{
animator.SetBool("IsMoving", false);
}
}
}