Quantcast
Channel: Questions in topic: "attach"
Viewing all articles
Browse latest Browse all 168

How to attach one object to another without parent-child relationship?

$
0
0
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!

Viewing all articles
Browse latest Browse all 168

Trending Articles



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