using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class feet : MonoBehaviour {
    public Transform lightObj;
    public float lightRange = 10;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}

    private void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.name == "Floor" || other.gameObject.name == "Table" || other.gameObject.name == "Chair")
        {
            var clone = Instantiate(lightObj, new Vector3(transform.position.x, other.transform.position.y + 1.0f, transform.position.z), transform.rotation);

            clone.GetComponent<Light>().intensity = 8.0f;
            clone.GetComponent<Light>().range = lightRange;
        }
    }
}
