- Home /
Muzzle Flash Prefab
Hi, I have a prefab muzzle flash. How to get a reference of this in its parent's scripts?? I want when trigger is clicked it triggers this prefab animation. Though I know it is an easy question but it is not clicking in my mind. It is not a particle system. It has .prefab extension. I don't know by using which reference object we can access it. Right now it is permanent glowing. The selected prefab in project panel is that flash and look at its inspector.
I have downloaded an asset pack and it is its sub part. It is not an animation. It has .prefab extension and not .FBX .
Can you post a picture of it including its components?
Answer by bennett_apps · Aug 01, 2018 at 05:14 PM
Use transform.GetChild(0).GetChild(0).GetChild(0).gameObject...change the number of getchild statements depending on where your script is.
I believe he wants to know how to actually play the muzzle flash and for it to be set active(false) while firing is false. Which is why im asking him to post his scripts.
@Carterryan1990 Thank you for your time :) But now I think of making my own particle system, this will work better.