← Комьюнити

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

student_wrbhIBmn1 ответов
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;
         }
    }
}   

1 ответов

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

student_BUOPPsrj