Muzzle Flash position

Steinvorth

Member
I was wondering how I can properly add a muzzle flash to my gun, i have a particle effect I wish to add. The problem is that when I put it, then the position is not correctly fixed, so the muzzle effect is waaaaay off in the distance. How can I fix this?
 
I did the steps that the forum says to follow, and also the ones you suggested, but the effect seems to still be a long ways away from the position
 
Hm, is this in first or third person? If you watch the muzzle flash's transform in the demo (pausing whilst shooting may make it easier, you can do this easily in the demo scene by simply pressing Ctrl+Shift+P since Ctrl is defined as a "Use" input), is its transform pivot point accurate or does the muzzle flash always seem to spawn at the same location (e.g. 0,0,0)?
 
This is in first person, since I am trying to make a first person shooter. The flash seems to spawn at those coordinates, although I have adjusted the spawn to be at the tip of the gun, also, if I look around, the flash seems to stay at the same position, it does not follow the player, if I make myself clear.
 

Attachments

  • 1636043055745.png
    1636043055745.png
    95 KB · Views: 3
  • 1636043077519.png
    1636043077519.png
    18.3 KB · Views: 3
Based on what you've said it still sounds like the muzzle flash transform isn't part of the first person rig hierarchy. In the demo it can be found in the first person hierarchy as a child of each weapon:

1636107450501.png

You may have added the transform to a different part of the hierarchy by mistake
 
hmmm, in my hierarchy it is set the same as you have shown in the picture. My only guess is that the particle FX I am using is somehow not fixed in a position, because I tried with the muzzle flash from the demo scene and it seems to work fine. Is there some way of making this particle stay in place?
 

Attachments

  • 1636270618549.png
    1636270618549.png
    40 KB · Views: 0
If your position is 0, 0, 0 then it does sound like it's the particle. I am definitely not an expert on the particle system so I recommend posting that on the Unity forum :)
 
I found the fix. The prefab had the position component different, so it was causing it to spawn in a different place. I just reset the position, and its working as expected :)
 
Top