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

public class TrampolinScript : MonoBehaviour
{
    public float speed = 1000;

    private void OnTriggerEnter(Collider collision)
    {
        Rigidbody rb = collision.gameObject.GetComponent<Rigidbody>();

        if (rb != null)
        {
            rb.velocity = new Vector3(0, 0, 0);
            rb.AddForce(transform.up * speed, ForceMode.Acceleration);
        }
    }
}
