using UnityEngine;
using System.Collections;

public class Throw : MonoBehaviour {
	public Transform lava;
	
	public Transform baseLava;
	// Use this for initialization
	void Start () {
		InvokeRepeating("CreateLavaItem",1f, 0.9f);
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void CreateLavaItem()
	{
		Transform t = Instantiate(lava, baseLava.position,baseLava.rotation) as Transform;
		Vector3 p = t.localEulerAngles;
		p.y = Random.Range(-60,60);
		t.localEulerAngles = p;
		t.rigidbody.AddForce((Random.Range (0f,200f) + 80f) * (Vector3.right  + Vector3.up));
	}
}
