using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///
/// ·ÕÏ
///
public class Roadblock : MonoBehaviour
{
///
/// ¸ÕÌå
///
public Rigidbody rb;
private void OnEnable()
{
rb.velocity = Vector3.zero;
}
///
/// »÷·É
///
public void ShootFly(Transform transform)
{
rb.useGravity = true;
rb.isKinematic = false;
rb.AddForce((transform.position - this.transform.position).normalized * -100, ForceMode.Impulse);
rb.AddForce(Vector3.up * 20, ForceMode.Impulse);
rb.AddTorque(new Vector3(Random.Range(-180, 180), Random.Range(-180, 180), Random.Range(-180, 180)), ForceMode.Impulse);
}
}