How to attach one object to another without parent-child relationship?
Hi,
As part of a project I'm doing, I need to model a ball with three accelerometers attached to it in Unity. To do this I've created a sphere that can be controlled through keyboard input, and attached three very small cubes to it at different points. I need to collect the positions and angular velocities of all four objects. Collecting the angular velocities require me to attach a rigid body component to each object, which prevents me from making the cubes children of the sphere.
However, I would still like to attach the cubes to essentially be fixed at some point on the surface of the sphere. But how can I do this? For placing the cubes I've been messing the Transform section of each cube object in the inspector but this hasn't worked out well. Is there a way to pick the position, through a script attached to each cube, relative to the spheres local coordinates?
As for fixing the cubes in place, I've been forced to use the hinge component since I can't make the cubes children of the sphere. I have some doubts about this, so I'm just wondering if using the hinge component is an ok way to attach one object to another, so that they essentially move together while still being independent to a degree?
I appreciate any help or advice that you can offer, so thanks in advance!
Your answer
Follow this Question
Related Questions
How attach C# script by argument? 3 Answers
How to place a sprite on the face of a collider 0 Answers
Level multiple data values should I use a list? 0 Answers
Attach a shield to player (C#) 2 Answers
How can I check if a object in the hierarchy have been destroyed using EditorWindow type script ? 1 Answer