Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class RemoteCubePosition : MonoBehaviour {
- public GameObject goTheCube;
- CubePosition cpTheScriptOnTheCube;
- void Start ()
- {
- //Get the CubePosition script from the cube object
- cpTheScriptOnTheCube = goTheCube.GetComponent();
- }
- // Update is called once per frame
- void Update () {
- //Set the global variables to this objects coordinates with an offset of 3
- cpTheScriptOnTheCube.fX = gameObject.transform.position.x-3;
- cpTheScriptOnTheCube.fY = gameObject.transform.position.y-3;
- cpTheScriptOnTheCube.fZ = gameObject.transform.position.z-3;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement