← Комьюнити

Вот что скажите, в чем проблема?

student_wrbhIBmn0 ответов

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;
         }
    }
}   

0 ответов

Ответов пока нет.