Вот что скажите?

0
using System.Collections;
using System.Collections.Generic;
using EnityEngine;

public class Player : MonoBehaviour
{  
    [SerializeField] Keycode keyOne;
    [SerializeField] Keycode keyTwo;
    [SerializeField] Vector3 moveDirection;

     private void FixedUpdate()
    {  
                if (Input.Getkey(keyOne))
         {
             GetComponent<Rigidbody>().velocity += moveDirection;
         }
            if (Input.GetKey(keyTwo))
         {
          GetComponent<Rigidbody>().velocity -= moveDirection;
         }
    }
}   
c#

1 ответов

0

В чем вопрос-то?

Sign up or Log in to write an answer