Hello!
So I’m trying to do the easiest of things, rotate an object. Here’s the code:
using UnityEngine;
using System.Collections;
public class WheelRotator : MonoBehaviour {
public int speed;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
transform.Rotate(Vector3.forward, speed * Time.deltaTime, Space.World);
}
}
Seems easy. Problem is, I absolutely need the object to be a child of another object (due to how I’m generating the game’s world). However, when rotating a child object, it gets stretched and distorted awfully:
It’s incredible that I’ve been in Unity for about a year and only now got stumped by this. It gets stretched even when changing the Z component in the editor manually. Is there any way at all to rotate a child gameObject without messing up its shape?
Thank you!
