I made this script and it some times works but usually it doesn’t.
heres the script
using UnityEngine;
using System.Collections;
public class Pyhsics : MonoBehaviour
{
private bool attatched = false;
public Rigidbody rigbody;
void OnCollisionEnter(Collision col)
{
if(attatched == false)
{
if(col.collider.gameObject.tag == "Finish")
{
if(col.collider.gameObject.GetComponent<FixedJoint>() == null)
{
col.gameObject.AddComponent("FixedJoint");
}
FixedJoint Join = transform.gameObject.GetComponent<FixedJoint>();
if(Join.connectedBody == null)
{
FixedJoint J = col.gameObject.GetComponent<FixedJoint>();
J.connectedBody = rigbody;
J.breakForce = 8;
J.breakTorque = 8;
if (col.relativeVelocity.magnitude > 20)
audio.Play();
}
}
}
}
}
some
others