var TargetObject:Transform;
function OnGUI(){
if (GUI.Button( Rect( 10, 10, 80, 80), "RESET ROTATION"))
{
TargetObject.Rotation=Quaternion.Euler(Vector3(0,0,0);
}
}
so all im diong is assing the target object to the variable TargetObject, it then grabs the rotation of it. Quaternion is just the rotation class, and Euler changes the new Vector3 to a rotation value, so it assigns it to the rotation (0,0,0)
I tried this and it doesn’t work. For some reason there is a missing field exception because of the transform.Rotation script. I would think it would work because the script is pretty straight forward, but I was wrong. Any suggestions?
And some of the code is written in a language that is no longer used in Unity (Unity script). “Absolute lies ;-;”
You can still use IMGUI UI for editor scripting. But you’ll have to write everything in C# language.
And this one still pretty much works as is, as long as you have a gameObject called theGameObject in your script or if you remove the theGameObject part: theGameObject.transform.rotation = Quaternion.identity;
Are we just recreationally necroposting now?
Make your own post, ask your question, add the details of what you’re trying to do in your situation, we cannot possibly help you with the sentence “I’m looking to smoothly rotate”.