NullReferenceException: Object reference not set to an instance of an object Bala.FixedUpdate () (at Assets/Scripts/Bala.cs:18)
quando vou atirar o jogo pausa . esse e o codigo do script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bala : MonoBehaviour
{
public float Velocidade = 20;
private Rigidbody rigidbodyBala;
private void start()
{
rigidbodyBala = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
rigidbodyBala.MovePosition
(rigidbodyBala.position +
transform.forward * Velocidade * Time.deltaTime);
}
void OnTriggerEnter(Collider objetoDeColisao)
{
if(objetoDeColisao.tag == "Inimigo")
{
Destroy(objetoDeColisao.gameObject);
}
Destroy(gameObject);
}
}