- Home /
Question by
metebayhan · Feb 08, 2020 at 11:17 AM ·
3daddforceangle
add a force at an angle 3d
float angle = Random.Range(0, 45) Mathf.Deg2Rad; rigidbody.AddForce(player.transform.forward 50 * Mathf.Sin(angle),ForceMode.VelocityChange);
I tried this line of code to force a ball at an angle. But i couldnt make an angle. Can someone check.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612222912im_/https://answers.unity.com/themes/thub/images/avi.jpg)