Inspect Points - Custom Event

The Cardboard box lid - Inspect Point

1). These should be setup as such:

  • Tag: InspectPoint

  • Layer: InspectPointMask

  • Add: Box Collider

  • Add: ExamineInspectPoint script

Add the "InspectReveal" script to your inspect point, then add itself to the "Click Event" box by add an event with the "+" symbol. You can choose the method you'd like to run when clicking on an inspection point. See the code below which will hide the box lid and reveal the key.

     public void RevealHidden()
        {
            objectToHide.SetActive(false);
            objectToReveal.SetActive(true);
        }

The Key - Inspection Point

Do the same for the key but this time we'll run a different method, as below which will hide the key when selected and you can add custom functionality from there.

        public void PickupExample()
        {
            objectToHide.SetActive(false);
            Debug.Log("Add some additional code for when this item is collected");
        }

You can add sound effects to each of these actions by adding another event by click the + in the special interaction. Then adding the Audio Manager gameobject and then adding the ScriptableObjects audio you want to use.

Last updated

Was this helpful?