# Muzzle Flash Rotation is Facing wrong way. C++/VFX

**URL:** <https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276>\
**Category:** FX\
**Tags:** unreal-engine, question, CPP\
**Created:** [October 1, 2020, 10:46pm UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276 "2020-10-01T22:46:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quaked54](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Post date:** [October 1, 2020, 10:46pm UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/1 "2020-10-01T22:46:35Z")

</div>

if (MuzzleFlash)  
{  
UGameplayStatics::SpawnEmitterAtLocation(GetMesh(), MuzzleFlash, FP\_Gun-\>GetSocketLocation(FName(“Muzzle”)));  
}  
I have messed around in the particle editor in order to be able to find the reason why the muzzleflash rotates itself when I rotate the character I am not sure if it is the muzzle socket itself or the muzzleflash emitter. Does anyone have any recommendations on how to keep the rotation static. When Firing a weapon.

---

<div class="post-metadata">

**Author:** ![MagicznaFlet6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MagicznaFlet6](https://forums.unrealengine.com/u/MagicznaFlet6)\
**Post date:** [October 2, 2020, 7:07am UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/2 "2020-10-02T07:07:22Z")

</div>

I didn’t have this problem and I spawned my emiter like this:

```
UGameplayStatics::SpawnEmitterAttached(MuzzleFlash, Mesh, TEXT("MuzzleFlashSocket"));
```

---

<div class="post-metadata">

**Author:** ![Quaked54](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Post date:** [October 2, 2020, 10:42am UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/3 "2020-10-02T10:42:15Z")

</div>

I tried your code and mine both result in the MuzzleFlash not being able to be static. When facing different directions.

---

<div class="post-metadata">

**Author:** ![Quaked54](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Post date:** [October 2, 2020, 10:43am UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/4 "2020-10-02T10:43:47Z")

</div>

This is really off I don’t know why the emitter rotates when I turn…

---

<div class="post-metadata">

**Author:** ![Quaked54](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Post date:** [October 2, 2020, 10:45am UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/5 "2020-10-02T10:45:30Z")

</div>

I know one thing for a fact that the particle system is attached to the muzzle.

---

<div class="post-metadata">

**Author:** ![Quaked54](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Post date:** [October 2, 2020, 12:21pm UTC](https://forums.unrealengine.com/t/muzzle-flash-rotation-is-facing-wrong-way-c-vfx/472276/6 "2020-10-02T12:21:05Z")

</div>

![316941-camerafacing.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/e/1ee6da2d8bcd5d5551aa8ab0aff4e42e1b6ee172.png)

I set the mesh data to camera facing and it fixed the MuzzleFlash problem. If anyone is having this problem this might be the solution.
