Download

Shooting And Reloading Function

I want to make shooting and reloading functions in my Gun_Base.
But they don’t work. The player character is casting all the functions.



The animations work but not the Linetrace or the reloading

And the default value of ammo in mag is actually greater than 0?

1 Like

No Its At 0.

Well… No bullets, no firing.

1 Like

I changed it to 1 and it still doesn’t fire.

Place a print string right after Fire → does it print?

1 Like

Yes.

Place it after line trace, does it print? I so, the lines trace does fire.


In your previous example, you were happy to use the camera to aim, you can still do it:

Perhaps the mesh is facing the wrong way.

Yes It Does.

OK It Does Shoot But Only When I Am Moving And It Shoots The Wrong Way

You can use right vector of the mesh (instead of forward) or use the camera manager as in the screenshot above.

In UE4 X is forward, the default gun is set up like this:

If your skeletal mesh is set up the same way (quite likely), were you to use X Forward you’d shoot to the left.

Thank You Sooooo Much It, Works Like A Charm By Using Camera Manager And Setting Trace Channel To Visibility

1 Like

If You Have Time I Have One More Problem With The Hud.

Do tell!

1 Like

My HUD Is Not Working the numbers don’t change and i would like the image to change depending on what gun i am on.

  • can you show how the player creates the widget
  • and how you were updating it before
  • you may also need to show how the guns are changed (how do we know which guns we’re using now)
1 Like

I Am So Sorry But I Just Realized I Have To Leave For My Class, I Will Come Back To This Topic In A Couple Of Hours, Again So Sorry And Thanks For All The Help.

2 Likes