Swinging a putter; how to reset rotation?
Hi,
I have a question that I'm not even sure I can ask correctly.
I want to simulate putting on a golf green. I have a putter that's a rigid body that has a hinge joint at the top that's connected to an empty object named _putter:
The picture shows the (correct) starting position. Now I start the putter swinging by setting the rotation: _putter.transform.Rotate(new Vector3(0.0f, 0.0f, -30.0f)); This works fine and the putter starts swinging from right to left and back again.
Here's what I need. When I click a button, I want to put the putter back in its original orientation. I can stop the rotation by setting freezeRotation = true, but I can't find the correct way to reset the rotation/localRotation. Plus, I don't know if I need to affect the empty object's rotation or the actual putter object rotation.
Any help would be greatly appreciated. Thanks. - Ed.
Your answer
![](https://koobas.hobune.stream/wayback/20220612055836im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to rotate camera based on player input 0 Answers
How to rotate parent only without affecting children(in editor) 2 Answers
Instantiated Object Has Wrong Rotation 0 Answers
Rotation and Gravity Relative to the Center of an Object 0 Answers
With VR character's rotation is applied twice or double 1 Answer