My question is how do I use addForce to fire an object straight forward at its rotation? I currently have 3 variable to calculate the addForce with. They are the vertical angle of projection, the power, and the rotation of the object. The current code I am using is:
function GetVectorForce(p : float,a : float) : Vector3{
var vH = p*Mathf.Sin(a);
var vV = p*Mathf.Cos(a);
var vector = Vector3(0,vV,vH);
return vector;
}
This works when the rotation is 0 but how do I calculate it with a different rotation variable so it will go forward at that rotation?
Thanks in advance