Quantcast
Channel: Answers by "CallToAdventure"
Viewing all articles
Browse latest Browse all 48

Answer by Airship Games

$
0
0
not really an answer since it doesn't work properly just yet. As the parent object gains speed the child objects rotates as it should - but as soon as I stop, the child object halts although the parent objects still has some velocity. here's the code I use. Also, I should probably use a local velocity and avoid using the GetAxis little hack. Any ideas? Much appreciated! var parentObject : GameObject; function Update(){ var speed = parentObject.GetComponent(Rigidbody).velocity.magnitude* 0.5f; var z=Input.GetAxis("Vertical")*5 *speed; var childObjects = GameObject.FindGameObjectsWithTag("stuff"); for (var childObject in childObjects) childObject.transform.Rotate(0,0,-z); }

Viewing all articles
Browse latest Browse all 48

Trending Articles



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