TheStable/Assets/Pyralix/Skee-Ball/Udon/Misc/OutOfBoundsReset.cs
Jamie Greunbaum 8eaef49f2e - Added game room, including pool and skee-ball.
- Moved video screen into its own separate movie tent.
- Adjusted stable post-processing volume.
- Chickens are now at full volume.
- Added button to toggle chickens off and on.
2026-02-09 03:49:54 -05:00

33 lines
1.0 KiB
C#

using UdonSharp;
using UnityEngine;
using VRC.SDK3.Components;
using VRC.SDKBase;
using VRC.Udon;
namespace Pyralix.SkeeBall
{
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class OutOfBoundsReset : UdonSharpBehaviour
{
//this function is called every time the collider of the gameobject to which this script is attached...
//...collides with another collider
private void OnTriggerEnter(Collider obj)
{
if (Utilities.IsValid(obj) && obj != null && obj.GetComponent<Ball>())
{
obj.gameObject.GetComponent<Rigidbody>().isKinematic = true;
obj.gameObject.GetComponent<Rigidbody>().angularVelocity = new Vector3(0, 0, 0);
}
}
private void OnTriggerExit(Collider obj)
{
if (Utilities.IsValid(obj) && obj != null && obj.GetComponent<Ball>())
{
obj.gameObject.GetComponent<Rigidbody>().isKinematic = false;
}
}
}
}