using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
private Animator animator;
private float timeAnimation = 0;
// Start is called before the first frame update
void Start()
{
animator = GetComponent();
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.W))
{
animator.SetBool(“IsHeWalkingLeft”, true)
}
{
for (TimeAnimation + 1,TimeAnimation == 21)
{
animator.SetBool(“IsHeWalkingLeft”, false);
}
}
}
}
Use code tags so that we can read it better.
Don’t just give us the error code, show us the entire error message as that tells everyone what line the error is on and if you had used code tags we could match the message to the correct line.
But at a glance, you are missing a ; at the end of this line animator.SetBool("IsHeWalkingLeft", true).
This for loop doesn’t look right eitherfor (TimeAnimation + 1,TimeAnimation == 21)
Look up some for loop examples. Also the capitalization of “TimeAnimation” doesn’t match the declared variable.