Download

Bullet fires out of middle of character

Hello,

I have followed several of the tutorials on you tube about how to fire a projectile. I attached a gun to the right hand of my character, and set up the blue print to fire the projectile. But no matter what I tweak I can not seem to figure out how to get the projectile to fire out of the weapon instead of the middle of my characters body. I am still very new to blueprint, so im sure I am missing something. I am now going on day 3 of having bullets shoot out of my guys privates lol. Any help is greatly appreciated.

Thanks,

Quigs

I haven’t worked on this specifically - but generally when you create the projectile you would want to spawn the actor with the transform of the point you want it to fire from your gun.

Yeah, you need to find the current world position & transform of the guns muzzle, and spawn your projectile with that transform.

A good way to do it, is add a socket to your weapon mesh, then retrieve the world position and transform of that socket when you fire the weapon, and transfer that data too the projectile on spawn.

still messing with this and can’t quite figure it out. Do you know of any example blueprints I could look at? I am trying to do this on a third person character if that makes a difference. Thanks for your help with this. I have also attached a picture of the blueprint that is in there to make it shoot out of his midsection…

Quigs

Edit the skeleton you’re using, find the location best suited for your muzzle and make a socket called muzzle. Then launch your projectile from the position of that socket.

Have you check the FPS BP project?
You can also check this tutorial: turret.
The shooting BP logic is the same, the only difference is that in this tutorial he set the sockets in a static mesh, so all you need is to set the socket in the skeleton instead of the static mesh, as Drexciya said, and use the same bp logic.

Thank you everyone for the responses I will look those over when I get home. This has been melting my brain for a few days now lol

Look for the bone or dummy position and offset the bullet spawn to it. You will also need these info for bullet casing, Muzzle and a tracer.

You can also add sockets and spawn it from there, but also can add a vector transform to adjust the offset of where the projectile comes from.

I got it working, thank you guys for all of the help with this.

Create a shocket in the weapon.
firefromshoket_01.JPG

Put the weapon in the character using a skeletal mesh component
firefromshoket_02.JPG

Set the EventGraft(in character) for shoot from the socket
firefromshoket_03.JPG