Shooting mechanic for football game

Hi, is there any possibility to add a shooting mechanic for my football game ? Thank you

type or paste code here

The possibility surely exist, perhaps you could add more details to the question?

Well I just want to add a mechanic that allows me to shoot a football, I haven’t tried anything yet but perhaps you could help me because I haven’t found any video.

Apply an impulse to a mesh that simulates physics. With no details, it’s pretty much impossible to suggest anything tangible. :expressionless:

  • how would you like to choose direction?
  • how would you like to choose force?
  • do you even want to use physics sim?

If you need help, you may need to elaborate a bit more.

Well, first of all I would like to choose direction either with the left joystick of a controller or with the mouse. I would like to choose force so when I shoot depending on the time I hold the trigger it shoots stronger or slower. But I have tried to find videos that might help me but I haven’t found anything

If you’re not familiar with the Enhanced Input, that would be the first thing to look up. See if you can set it up first. It will allow you to produce a vector that can be translated into direction and force. Here’s a little example:

But the EI (that was not available back then) would make setting it up more streamlined.

Ok, thanks I will try to do this

Hi, is there any video that could help me when copying your screenshot because there are some things that don’t appear such as static mesh, magnitude if you could send me a video so it is easier for me please. Thank you

I do not make video tutorials.

static mesh

It’s a static mesh component you add to your actor, it represents the mesh - a ball, for example. Once added, drag it to the graph to GET its reference variable.

magnitude

It’s a float variable. Have a look at how to work with variables:

ok thanks