using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Threading;
using UnityEngine;
public class Bala : MonoBehaviour
{
// Update is called once per frame
public float Velocidade = 30;
void FixedUpdate()
{
GetComponent<Rigidbody>().MovePosition
(GetComponent<Rigidbody>().position + transform.forward * Velocidade * Time.deltaTime);
}
void OnTriggerEnter(Collider CollisionObject)
{
if (CollisionObject.tag == "Inimigo")
{
Destroy(CollisionObject);
}
Destroy(gameObject);
}
}
Quando atiro a bala desaparece ao tocar objetos do cenário, mas não ao tocar o zumbi. Além disso, os zumbis estão entrando um dentro do outro e já chequei se estão com o Rigidbody e o Capsule Collider, os quais estão presentes.