// Start is called before the first frame update void Start() { // Grab reference to the makeBlock script. mb = this.gameObject.GetComponent <MakeBlock>(); thisBlock = mb.ThisBlock; startingPoint = this.gameObject.transform.position; // Set starting movement. isMoving = true; goingForwards = true; // Set out movement variables and make calculations. distance = Vector2.Distance(startingPoint, endingPoint); distancePerFrame = distance / travelTime; spacePerFrame = (startingPoint - endingPoint) * distancePerFrame; }
// Start is called before the first frame update void Start() { instance = this; Canvas2 = ccc.transform; Canvas2.transform.position = new Vector3(0, 0, 90); }