using UnityEngine;
public class player : MonoBehaviour
{
public float jumpForce = 10f;
public Rigidbody2D rb;
void Start()
{
rb = GameObject.FindWithTag("player").GetComponent<Rigidbody2D>();
}
void Update()
{
if(Input.GetMouseButton(0))
{
rb.velocity = Vector2.up * jumpForce;
}
}
}
Выдает ошибку: The variable rb of player has not been assigned.