Персонаж в юнити не двигается.Что делать?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
[SerializeField] KeyCode KeyOne;
[SerializeField] KeyCode KeyTwo;
[SerializeField] Vector3 MoveDirection;
private void FixUpdate()
{
if (Input.GetKey(KeyOne))
{
GetComponent<Rigidbody>().velocity += MoveDirection;
}
if (Input.GetKey(KeyTwo))
{
GetComponent<Rigidbody>().velocity -= MoveDirection;
}
}
}
По дате
По рейтингу
Хз я на джаве
Больше по теме