- Home /
dynamic rotation distance
Hi,
I have what I hope is a simple problem to solve. I have 'object B' parented to 'object A' while 'Object A' is told to rotate. I want to be able to dynamically alter the distance of B from A while it still appears to orbit/rotate as object A rotates. So far whenever I try to change object B's x-translation it ruins the parenting/rotation.
I'd appreciate any help with this
Answer by biohazard · Jun 30, 2011 at 12:27 PM
http://unity3d.com/support/documentation/ScriptReference/Transform.LookAt.html
thank me later :p
Also consider to unparent the objects.
I've looked through a whole heap of the unity scripting material, but I just can't get my head around how to set this up. I'm still a bit new to scripting you see.
I can set up the unparented object to rotate around Vector3.zero, but I don't know how to make it rotate closer to or further from this set point. Don't hold out on me here man!
give them objects a hinged joint or try using rigidbody.AddForce, thats all my $$anonymous$$d hits up when i read your question
Alright I'll try those out and see if I can get anything close.
Thanks for your help with this, much appreciated.
Your answer
Follow this Question
Related Questions
Move and Rotate object with "Parent" without Parenting 1 Answer
Problem combining transform.rotation and hierarchical rotations 2 Answers
Keep camera at certain distance from character when rotating 3 Answers
AddForce to parent based on child's rotation C# 1 Answer
Rotation problems when I child a sword to players hand! (pictures within to clarify) 1 Answer