I´m working on a little football project, as I managed to create a striking feature I wanted to be able to create swerves/curves on said strikes, in my case I used this on my code:
void Update()
{
if (Input.GetKeyDown (KeyCode.RightShift))
{
Rigidbody rb = GetComponent<Rigidbody>();
rb.velocity = StrikeVec() * power;
isKicked = true;
}
if(isKicked == true) // Curve force added each frame
{
Rigidbody rb = GetComponent<Rigidbody> ();
Vector3 myLeft = Camera.main.transform.forward + new Vector3(0.5f,0,0);
rb.AddRelativeForce (myLeft * 0.5f, ForceMode.Impulse); //THIS IS WHAT IM USING
}
}
But I was wondering, if you, the reader, had to do this what would you think would be the “correct” way to develop it. I know there is not a “correct” way, but which one do you think its the most suitable?
I´m open to all kind of answers, no code replies necessary.
Thanks in advance!