Broadcasting a game objects position so other game objects can position themselves accordingly

I have an equation which I am scripting onto GameObjectB…

Part of this equation is GameObjectB’s position… What is the easiest way of subbing these coordinates into the script…

The following script is assigned to GameObjectB… it is intended to transform the position of GameObjectB along the z axis relative to the position of GameObjectA and a futher variable named MyFloat…

1 using UnityEngine;
2 using System.Collections;
3
4 public class GameObjectBPositionScript : MonoBehaviour {
5 float MyFloat = 2.5;
6
7 // Update is called once per frame
8 void Update () {
9 transform.Translate ( 0f, 0f, GameObject A’s Position / MyFloat );
10 }
11 }

I need to be doing this for two dozen other game objects at the same time also…

Many thanks Unity’ers :smile:

Look at this page:

http://docs.unity3d.com/Manual/ControllingGameObjectsComponents.html

Specifically the “Accessing Other Objects” section. I believe the example on this page is 99% of what you want to do.

Thanks you very much… Simply getting to the right tutorial is half of my problem… Although gradually I am coming to terms with the concepts and terminology, helps a lot :smile: