sprite walk animation images code example
Example 1: css image sprites
<html>
<head>
<meta charset="UTF-8" />
<title> Title </title>
<style>
#window_1 {
height: 120px;
width: 117px;
background: url("image_path") 0px 0px;
}
#window_2 {
height: 150px;
width: 100px;
background: url("image_path") -300px -200px;
}
</style>
</head>
<body>
<div id="window_1"></div>
<div id="window_2"></div>
</body>
</html>
Example 2: animate sprite sheet unity in code
[SerializeField] Animator anim;
//must drag in the animator that you are using
public void StartAnimation()
{
//can be a float, int, bool, or trigger
//string is the name of the parameter in the animator
anim.SetBool("isAttacking", true);
}