Created
September 20, 2018 19:37
-
-
Save davepape/74f8e9a528306ade494c3e9d6d033681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unity3d example of using Find() and GetComponent() to control one script from another script | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class mcp : MonoBehaviour { | |
void Start () { | |
} | |
void Update () { | |
GameObject thecube = GameObject.Find("Cube"); | |
circle1 circlescript = thecube.GetComponent<circle1>(); | |
circlescript.speed -= Time.deltaTime; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment