Need Help Spawning Projectile From Weapon Socket

Hello,

I recently created a simple weapon pickup blueprint that attaches the weapon to an assigned socket when the player walks over it. Now I am working on adding on to that BP by adding the ability to fire projectiles from a “Muzzle” socket I created on the weapon. I have all of the logic laid out already but there is one small thing that isn’t working correctly that I need help with. The “bullets” seem to be flying out from the Muzzle socket at random directions depending on which direction my character is facing. For the most part they seem to fly out negatively on the X axis (north). So for example, facing the character that same direction, facing left and facing right all produce this (resulting in bullets flying out correctly, from the right of the gun and from the left of the gun). However, facing the character positively on the X axis (south) results it bullets flying out at an angle toward the bottom left of the screen. Sometimes bullets seem to “spray” in a short fan motion.

If someone could help with this I’d really appreciate it! I just need the bullets to fire out in a straight direction from the muzzle in front of wherever the weapon is facing. I’ve attached a screenshot of my BP as well as the settings for my projectile. I’ll try to get a small clip uploaded later if needed.

][1]

  1. Why is bullet max velocity 0? It should at least be the same as initial velocity.
  2. Why are you getting the “controller” rotation? Those values go from 0-360, whereas everything else is on a (neg. 180 to 180) axis. That is probably the issue. What you want is “get SK gun” rotation if that is where the projectile will be spawned from or “actor” rotation since the entire actor should face the direction of the muzzle I assume when being fired.

Wow thanks that did the trick! Not sure why I had that, I think a tutorial had it and that’s why.

I replaced “get control rotation” with “get socket rotation”.