0% found this document useful (0 votes)
29 views1 page

Disable Cs

Uploaded by

shlokpatel3469
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Disable Cs

Uploaded by

shlokpatel3469
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

using System.

Collections;
using System.Collections.Generic;
using UnityEngine;

public class Disable : MonoBehaviour


{
[Header("Set this as the object you want to Disable.")]
public GameObject objectToDisable;

private void OnTriggerEnter(Collider other)


{
if (other.tag == "HandTag")
{
objectToDisable.SetActive(false);
}
}
}

You might also like