using UnityEngine;
using System.Collections;

public class BallLauncher : MonoBehaviour {

	// Use this for initialization
	void Start () {
		Rigidbody rb = gameObject.GetComponent<Rigidbody>();
		rb.velocity = new Vector3(0, 0, 5);
	}

	void OnCollisionEnter(Collision collision)
	{
		Material m = gameObject.GetComponent<MeshRenderer>().material;
		m.SetColor("_Color", new Color(Random.value, Random.value, Random.value));
	}
}
