Question on bullet-flight / external ballistics

Hey there,

I got a question concerning using ballistics in Unity.

Is it possibile, to script a realistic bullet curve with own properties for each kind of ammo used?

Like ammo 1 has flight-curve A, but when you use ammo 2 it has flight-curve B?

Additionally: Is there a way to change the power of the bullet? I saw some FPS-projects where the bullet hits a tin and the tin just falls back like one hit it with a ping-pong ball. Would it be able to let it be hit by way more power? And is there a way to tell my bullet how long it has to be on it’s way before it hits a target at a certain distance?

I think this is all about vectors and stuff, but I’m unfortunately not very good in those things.

Best wishes and thanks in advance,

Carni

edit: I don’t expect answers that totally solve my problem, but some hints to the relevant parts of the documentation or to a tutorial would be really nice!

The easiest way to handle this is to use the physics engine. With this, you can set the bullet’s mass and drag and also vary the amount of force used to propel it. From that point on, all the calculations are handled for you, including the collision and its effect on the target. However, the physics engine is not appropriate if you need to set the exact target point and have the bullet fly to it. In this case, it can be quite difficult to “reverse engineer” the firing parameters to get the right flight path for the bullet.

Is there any more detail you can give about how the bullets will operate within the game?

Bullet projectiles seem a little unprofessional in practice.

I’m thinking of going with all raycasts for accuracy, and saving projectiles for some other effects.

One thing you need to make sure of, that you are working to the correct scale. A cube is 1m square when you create it. Your characters should be therefore about 2x or 3x the size of a cube. This affects physics, according to the reference guide.

You can choose the mass of the bullet, you could write a script to add random wind or other factor, and the hitbox all affect it. You could have its rigidbody collision affect collision or you could also write a script to make it instantiate other forces.