olá, Meu GameObject esta dando erro.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bala : MonoBehaviour {
public float Velocidade = 20;
// Update is called once per frame
void FixedUpdate () {
GetComponent<Rigidbody>().MovePosition
(GetComponent<Rigidbody>().position +
transform.forward * Velocidade * Time.deltaTime);
}
void OnTriggerEnter(Collider objetoDeColisao)
{
if (objetoDeColisao.tag == "Inimigo")
{
Destroy(objetoDeColisao.GameObject);
}
Destroy(gameObject);
}
}
Erro: Assets\Scripts\Bala.cs(20,33): error CS1061: 'Collider' does not contain a definition for 'GameObject' and no accessible extension method 'GameObject' accepting a first argument of type 'Collider' could be found (are you missing a using directive or an assembly reference?)