With this script it makes the child objects rotate based on the parents position, I want to implement something that will allow me to change the parents scale but not have that affect the child scale. Any ideas how I could implement that into this script ?
using UnityEngine;
using System.Collections;
public class Tutorial_3_Q1 : MonoBehaviour
{
public Transform _parent;
private float eulerAngles;
void start()
{
}
void Update()
{
transform.RotateAround(_parent.position, _parent.rotation.eulerAngles, 50 * Time.deltaTime);
print(transform.eulerAngles.x);
print(transform.eulerAngles.y);
print(transform.eulerAngles.z);
}
void OnGUI() {
GUI.Label(new Rect (10, 10, 200, 20),"Euler Angle x ="+ transform.eulerAngles.x);
GUI.Label(new Rect(10, 30, 200, 40), "Euler Angle y ="+ transform.eulerAngles.y);
GUI.Label(new Rect(10, 50, 200, 60), "Euler Angle z ="+ transform.eulerAngles.z);
}
}
↧