I need a little help with the math for physics.
Imagine you are shooting bullets from a cannon and depending on angle of the cannon bullet lands at different spots. The force applied to bullet is Unity impulse type.
What would be the best way to calculate what angle I must shoot from to make sure bullet always lands at specific point on the ground?
Vector3 dir = Quaternion.AngleAxis(angle, Vector3.forward) * Vector3.up;
_Bullet.AddForce(dir * BulletSpeed, ForceMode.Impulse);
thanks in advance
The equations are
You can also try Projectile Shooter from Wolfram Alpha.