added animation and camera
camera movement is very basic, animation is just right facing lol. also i know the organization is a bit of a mess, i promise i'll fix it
This commit is contained in:
@@ -26,11 +26,14 @@ public class PlayerBehavior : MonoBehaviour
|
||||
[SerializeField] private PlayerMovement playerController;
|
||||
[SerializeField] private StateController stateController;
|
||||
|
||||
Animator animator;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
stateController = GameObject.Find("StateController").GetComponent<StateController>();
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -55,6 +58,19 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{
|
||||
LetGoOfGrapple();
|
||||
}
|
||||
|
||||
Animate();
|
||||
}
|
||||
|
||||
void Animate() {
|
||||
// start walking
|
||||
if (playerInput.actions["Move"].WasPressedThisFrame()) {
|
||||
animator.SetBool("Walking", true);
|
||||
}
|
||||
// return to idle animation
|
||||
if (playerInput.actions["Move"].WasReleasedThisFrame()) {
|
||||
animator.SetBool("Walking", false);
|
||||
}
|
||||
}
|
||||
|
||||
void OnMove(InputValue value)
|
||||
|
||||
Reference in New Issue
Block a user