Answers for "Add force for long pass ball"
http://answers.unity.com/questions/1630463/add-force-for-long-pass-ball.html
The latest answers for the question "Add force for long pass ball"Answer by tormentoarmagedoom
http://answers.unity.com/answers/1630464/view.html
Hallo.
First Qust:
AddForce is a vector. Doing this;
target.position - transform.position
You calculate a vector with the correct direction, but the magnitude of the vector depends on the distance between the 2 points. To have a better control of the force, you should convert that vector into a known magnitude vector with the same direction. Best way to do this is to [Normalize][1] the vector (so the magnitude will be always 1)
---
Second Qst:
Meybe the best solution if you want a parabole trajectory, is to add the vertical movement as a simple translate function (or changing directly its transform.position.y) To have a correct control of the height.
I think a good solution can be, once you know the origin and final points, you can calculate the middle point of that 2 points. Then while the object is moving increase its Y component a little each frame, until reach the midpoint (midpoint in X and Z components, as Y will change). Once reached this midpoint, decrease Y component again.
Good luck!
Bye!
[1]: https://docs.unity3d.com/ScriptReference/Vector3.Normalize.htmlFri, 10 May 2019 11:09:55 GMTtormentoarmagedoom