Projectile motion

Having a projectile launch position, target position and launch angle, how can I find:
*The required velocity to land at the target?
*The total flight time to the target?

I found an example, but in my case I have to deal with a different height at the target and calculate the flight time:
https://vilbeyli.github.io/Simple-Trajectory-Motion-Example-Unity3D/

Besides that, I thought about doing this process:
*Sometimes the target Y position will be lower than the launch position, so I guess I can reach the target with velocity variations, without changing the angle.
*Sometimes the target Y position will be higher than the launch position, so I will keep adjusting the angle to a higher one and try the step above some times (ex: first with 11º, then 22º, then 45º…)

  1. Create a new empty GameObject.
  2. Name it “LandPosition”.
  3. in MonoDevelop create a float timer, and set it’s value to 0.0f
    3.:

void OnTriggerEnter(Collider other)
{
// about one second
timer += 0.02f

if(oter.gameObject.CompareTag(“LandPosition”)
{
GUI.Label(new Rect(10,10,200,30), “Landed” + " Land time:" + timer);
}
}

Sorry brother, I did not understand what you mean.

I need the formulas to find:
*The required velocity to land at the target
*The total flight time to the target

As I said above.

Tks :slight_smile: