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

public class MoveOnCollision : MonoBehaviour
{
    public GameObject sphere;
    public GameObject cube;
    private void OnCollisionEnter(Collision collision)
    {
        print("Hello");
        transform.position = transform.position + transform.forward * 10f;
    }

    private void OnTriggerEnter(Collider other)
    {
        print("Hello trigger");
        transform.position = transform.position + transform.forward * 10f;
        sphere.SetActive(false);
        cube.SetActive(true);

        Destroy(gameObject);

    }
}
