UnassignedReferenceException: The variable rigidbody1 of Player has not been assigned. You probably need to assign the rigidbody1 variable of the Play
Скажите пожалуйста как сделать так как на картинке 1, чтобы нужен был один, поменял размер сделал один. А на втором сейчас так
Вот часть кода, помогите пожалуйста
public class Player : MonoBehaviour , IPointerDownHandler, IPointerUpHandler
{
[SerializeField] KeyCode keyOne;
[SerializeField] KeyCode keyTwo;
[SerializeField] Vector3 moveDirection;
public new Rigidbody rigidbody;
public Rigidbody rigidbody1;
public bool buttonPressed;
public void OnPointerDown(PointerEventData eventData){
buttonPressed = true;
}
public void OnPointerUp(PointerEventData eventData){
buttonPressed = false;
}
private void Update()
{
if (buttonPressed == true)
{
if(rigidbody != null){
Vector3 x = moveDirection * Time.deltaTime;
rigidbody.velocity += moveDirection;
rigidbody1.velocity += moveDirection;
}
}введите сюда код

