Hello to everyone. This is my first post.
I’ve been reading the manual and searching the forums here. Unity is incredible, especially for someone like me who used to program back in 1978 (old school) and I am now just getting my feet wet with how much has changed since the old days of coding.
Anyway, I’m just playing around with moving GameObjects on a playing field. I’m doing well with the learning curve. I have a question regarding rigidbody.rotation. I can’t seem to get the syntax correct.
What I’d like to do is make the gameobject turn (rotate some random amount) and then -
rigidbody.AddRelativeForce(Vector3.forward*Random.Range(0,25));
Can someone give me a suggestion or a code snippet to turn the rotation before I apply the AddRelativeForce? I’ve been playing around with rigidbody.rotation and also AddRelativeTorque, but I can’t seem to successfully rotate the gameobject a set number of degrees.
I know this is a simple question and thanks for any help.
Cheers.
Mitch