What is the name of the right and left keys of his keyboard in input?

I am looking for the names of these keys I can not find them on the internet to give an action to my animator do you know the name of these two keys?

t

thanks for help

Did you mean to include an image of the keyboard you’re talking about?

Do you mean LeftArrow and RightArrow? Or some special keys?

Quand il bouge pour aller à droite et à gauche je veux connaître le nom des deux touches du clavier droit et gauche

Please take a picture of your keyboard, or find a screenshot online, and circle the keys you’re talking about. We don’t know which keys you mean.

6605149--751420--toucheclavier.jpg

KeyCode.LeftArrow and KeyCode.RightArrow

If those aren’t working, please post the code you’re using where you can’t get them to work.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class animation : MonoBehaviour
{
private Animator animator;
// Start is called before the first frame update
void Start()
{
animator = GetComponent(typeof(Animator)) as Animator;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.LeftArrow) == true)
{
animator.Play(“walk”);
Debug.Log(“droite”);
}
if (Input.GetKeyUp(KeyCode.RightArrow) == true)
{
animator.Play(“walk”);
Debug.Log(“gauche”);
}
}
}

it gives that but the problem is that the animation is executed once the key is released, how to do when it appears just above without releasing it?

Remove the part where you tell it to play the animation after releasing the key?

if (Input.GetKeyUp(KeyCode.RightArrow) == true)
{
   animator.Play("walk");
   Debug.Log("gauche");
}

You probably just made a mistake with your GetKey* calls. For one, you used Input.GetKeyUp, and the other you used Input.GetKeyDown. It sounds like you want to use Input.GetKeyDown for both.