- Home /
Affect only one clone from multiple clones?
I'm trying to apply an effect to one clone among multiple clones upon trigger, but when it happens only the earliest instantiated clone is affected by this.
void OnTriggerStay2D (Collider2D target)
{
if (target.gameObject.tag == "Orb Bullet") {
if (syncAttack.isReflectUpwards && !reflectOnce) {
orbBulletObject.transform.Rotate (0f, 0f, -90f);
reflectOnce = true;
} else if (syncAttack.isReflectDownwards && !reflectOnce) {
orbBulletObject.transform.Rotate (0f, 0f, 90f);
reflectOnce = true;
}
}
}
Any solutions and suggestions to this problem is appreciated.
Comment
Answer by Vokzole · Jul 01, 2017 at 07:36 AM
I solved my own problem by changing the collision detection from using the "Shield Reflect" prefab to the "Orb Bullet" prefab. That way the detection becomes independent of each bullet.