var hit = false;
function OnCollisionEnter(collider : Collision)
{
hit = true;
}
function Update()
{
if(hit)
{
rigidbody.AddForce(transform.forward * 10 * Time.deltaTime)
}
}
↧