You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FlyingFred/Assets/HingeJointBreakReceiver.cs

23 lines
624 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HingeJointBreakReceiver : MonoBehaviour
{
void OnJointBreak(float breakForce)
{
Debug.Log("Hinge Joint broken! Break force: " + breakForce);
// Perform actions when the hinge joint breaks
HandleJointBreak();
}
private void HandleJointBreak()
{
// Example action: Spawn debris or play an explosion effect
Debug.Log("Handling joint break...");
UIManager.instance.GameOver();
// Add your specific logic here, e.g., play sound, destroy object, etc.
}
}