- Home /
The darkness that once perpetrated the very air that I breath hath been reduce to a mere puff of smoke by the fires of knowledge.
Rotating an object causes it to warp
I have an script in my scene that is designed to spin objects. It works well and the objects spin beautifully. However, there is a slight problem, whenever some objects are rotated they warp and stretch out. I am aware that past advice given to other unitarians has been to make the object a child of an empty Gameobject and set the value of the parent's size to be 1,1,1. I have tried this to no avail. So with a heart heavier than one made of lead I have come here seeking answers. Please shed your divine knowledge on me so that I made understand the villainy that troubles me so. Here is the code for my spinner script code:
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TM_spinner : MonoBehaviour { public bool regularSpin; void FixedUpdate () { if (regularSpin == true) { transform.Rotate(0.5f, 0.5f, 0.5f); } else { transform.Rotate(0f, 0.5f, 0f); } } }
And here is a screenshot of my object:
I'm not going to try to match the prose, but if you could provide screen captures of the transform data shown on the import settings for the meshes of the objects in question, that could help. It is likely that a non-uniform scale is causing issues as the rotation is occuring. Code would be useful as well.
You're very likely suffering floating point error. Those scales aren't helping you. 64000 units translates to about 64000 meters by default in Unity. I doubt a medieval sign would be that large. Try squaring away your exports.
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Distribute terrain in zones 3 Answers
How do I stop objects from rotating when they collide 2 Answers
Multiple Cars not working 1 Answer