Hi,I have set up a particle effect to become active based on collision detection and it all works great. Now I am trying to modify the script so that the particle effect only activates depending on the name of the object that is colliding with it. Can someone please review this script and tell me what’s wrong with? I have purposely changed the gameObject name in the script to “other” and the particle effect still activates even though the colliding object is actually named “arrow”. Also if I want to have two attached particle effects, one that reacts to the collision of an object named “arrow”, and one to an object named “fire”, is it best to just add individual scripts to the trigger object? or combine them in the one script?
Thanks!
#pragma strict
var blood : GameObject;
function Start () {
blood.SetActive(false);
}
function OnTriggerEnter (other : Collider) {
if(other.gameObject.name == "other")
{
blood.SetActive(true);
}
}