- Home /
please someone help. bullet impact effect is not showing up(smoke & sparks) but it's creating and destorying like in script
I followed YouTube tutorials for making fps shooter make muzzle flash with particle system in unity it worked but bullet impact effects not working
here is my script I made gameobject public and put my impact effect in that in scene view it is showing that when I hit bullet it creates that game object and also destroy it after 2 seconds like in script but that smoke and sparks are not appearing
https://www.youtube.com/watch?v=-1xzsyWiWMA video link bullet impact effect how it looks
https://www.youtube.com/watch?v=Sp-w6jVOGOA video link what it's not appering
Is “$$anonymous$$uzzleFlash” already exists in your scene or part of the “impactEffetc” prefab?
Answer by Jordash · Oct 22, 2018 at 08:46 AM
From your video it looks like the collision is occurring and the object is being created, so you don't have to worry about that at least.
You haven't shown your code for the game object that is created, so I'm not certain but you should make sure it is playing the particle effect as it is created.
This is outside what you have asked, but I find it is better to have a single global particle effect object that is re-positioned at each impact location then played. This prevents you from creating and destroying so many game objects.
I did show code for the effect but here it is again
that's the variable of the particle I am using
"d" is the code that should run this particle system I saw multiple YouTube tutorials everyone is doing like this brackeys etc
Oh so impactEffect is just a game object with a gameobject with a particle effect and no other scripting?
Is the particle effect set to "play on awake"?
Another aside, it is easier for others to read your code if you put it in code blocks.
not it is not set to play on awake should I?
Answer by aviad59 · Oct 22, 2018 at 08:44 AM
You need to instantiate the object. You just created it and didnt use it.
Your answer
Follow this Question
Related Questions
Shooting particle system? 0 Answers
Very basic Instantiate Question 2 Answers
Char shots oneside only / kills enemy on specific place. 0 Answers
Enemy Damage problem 1 Answer