Quantcast
Viewing latest article 9
Browse Latest Browse All 102

Keep Parent scaling independent to Child's (C#)

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); } }

Viewing latest article 9
Browse Latest Browse All 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>