Ballistic vector technique
Hello
This is a first person shooter game where I am trying to launch a projectile from a moving player, in a ballistic form. The "launcher" has a fixed fire strength, which means that the projectile if fired more horizontally will travel further before hitting the ground, likewise a projectile fired in a more upwards direction will go higher but will have travelled less horizontally when it hits the ground due to gravity. The firing vector is determined by where the finger touches the screen, and then multipled by a public parameter "firingstrength". Make sense so far?
What I am confused about is how to get this "vector" based on screen touch.
I have imagined doing this (I am new to Unity) by the following:
Empty object (Player): Contains - movement scripts - Camera - Invisible Inverted sphere in separate layer that surrounds the Player. I use this Sphere to do raycast from Player position in worldspace to where finger touched the sphere, and somehow calculate a vector from there, then multiply the vector by the "firingstrength" variable. Then apply the vector to a projectile instance.
Does this make sense or is there a better way to do this?
Kevin