my particles aren’t debugging or hitting my game object for some reason, i literally have the particles right in front of my game object and i’m pretty sure they are hitting, what could be the issue?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class PlayerDeath : MonoBehaviour
{
GetAudioSource audioSFX;
SceneLoader sceneLoader;
[SerializeField] GameObject ball;
[SerializeField] ParticleSystem deathVFX;
[SerializeField] Image loseScreen;
[SerializeField] Transform playerUI;
[SerializeField] float delayToShowScreen = 0.5f;
[SerializeField] GameObject laserParticles;
private void Awake()
{
}
// Start is called before the first frame update
void Start()
{
audioSFX = FindObjectOfType<GetAudioSource>(); // find this object and reference it whenever the variable is used.
sceneLoader = FindObjectOfType<SceneLoader>();
}
// Update is called once per frame
void Update()
{
}
public void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "DeathTrigger")
{
PlayerDying();
}
}
private void OnParticleCollision(GameObject laserParticles)
{
Debug.Log(ball);
PlayerDying();
}
public void PlayerDying()
{
Debug.Log("laser");
deathVFX.transform.parent = null; // deathVFX loses it's child relationship with player parent
deathVFX.Play();
audioSFX.audioSource.PlayOneShot(audioSFX.deathSFX, 1.5f); // plays audioSFX
Destroy(ball);
Instantiate(loseScreen, playerUI); // instantiates loseScreen as a child of UI game object
}
}