Skip to content

Example: Destroy Prop on Contact

Example using the Prop API and Prop Events to destroy any prop that enters its trigger collider.

1
2
3
4
5
6
7
8
// Destroys any prop that enters its trigger collider
public partial class PropDestroyer : WasmBehaviour
{
    private void OnPropTriggerEnter(Prop prop, Collider other)
    {
        prop.Destroy();
    }
}