Component attached to mesh in wrong location

I am having an issue spawning particles at the correct location relative to my character’s weapon in UE 5.3.2.

I have a gun that needs to have a muzzle flash and smoke come out the end of it when it fires. The skeletal mesh of the gun has a socket representing the end of the barrel where the particles should spawn.

For debugging, I have placed an arrow component in the BP, attached to the mesh at the socket. In the weapon blueprint, it appears at the correct place.

2024-09-12 08_22_49-Window
2024-09-12 08_23_06-Window
2024-09-12 08_28_10-Window

But when I play the game, the location of the arrow seems off. So I made these “CCTV” render targets to get a look at my character from the outside. Sure enough, the placement of the arrow is off. The test particles also spawn at the same location as the arrow. (Never mind the head on the ground, it’s just marking the camera location)


Weirdly, when I press F8 to eject from my character and look back at it, the arrow is in the right place, but still wrong in the “CCTV” view.

So what the hell is going on here? I guess I could just compensate and offset the arrow location in the BP, but I’d rather have it work properly. Any help is appreciated. Thanks in advance.

Video of the problem

My partner figured it out. We were using a method to avoid the weapon clipping into walls that involved some trickery with the materials. By switching back to regular materials we were able to solve the issue. We will use a different method to avoid weapon clip.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.