calculating bullet force to hit target

Hi there guys

I have attached an image to explain but basically I want to know - how can I calculate the force I need to apply to a projectile with mass M and angle A to hit a target at a certain position on a 2d axis. Is there some sort of built in math function?

Any help appreciated!

Thanks

665936--23869--$arc.jpg

With drag and spin it makes it a very hard equation, if you take that out and use the velocity rather than force you will find the answer by googling “a-level mechanics projectiles”. Its quite simple maths just cant remember it off the top of my head.

I can’t see why I can not use velocity. I will give it a shot, thanks.

If you don’t apply a drag and slow the projectile you won’t get parabolic motion. It probably is easier just to start the projectile with a set velocity though. If you are operating within the confines of the physics engine it will handle large slower moving projectiles fine just start them off and use a realistic drag and it will handle the rest. As they get faster (bullets) you’ll want to use your own discrete calculations.

If you are actually asking how to solve the equation - literally calculate how much force/initial velocity you need hit a target - Google parabolic motion. I seriously have no idea what unity’s ‘drag’ unit represents but you’ll need to know that to come up with a similar answer to what unity does. I gather it’s not newtons, and it doesn’t appear to be a drag coefficient… I wish they weren’t so afraid of scaring the “slider” crowd with units. Just label the damn things already; people who have no idea can still use the damn sliders and guess.

well, actually, what I’m thinking at the moment is to place by 2 objects at set points, shoot the bullet until it hist the target, look at the values and reverse engineer the calculation.

I think you are describing “guessing”. You mean you fire the projectile at various speeds (say between 100kph and 300kph), detect the one that hits and that’s your answer?

You could certainly do that but but if you are doing it at run time the player is going to have to wait for the “calculations”. Might be worth spending a few hours learning projectile motion - could come in handy.

Also I guess I should correct myself you can have projectile motion with a constant velocity but not a constant Vector… which is what most people are working with in Unity. You can keep your x or z components static… but Y needs to change =)

mmm…not exactly what I meant. Basically what I want to try is to figure out the calculation I need to use, based on existing values. What I mean is if I have the x and y of object A as well as the x and y of object B, I have the projectile start and end coordinates and the angle at which it started with, I should be able to “compile” my own formula and then work that into the game. It a bit difficuilt to explain what I mean;) I will post results if I get my theory to work!