Class and Learning Communication
Unity
If time allows
Presentation
https://NewSchool.zoom.us/rec/share/eoDeK2CWaYRpFG3xyfmYuZdERuktTRG4fO2u_p9N20-U1Pij_fukLkbzRRfA6DqJ.dOtA1P4P1IVTcqt0
Passcode: !?H%B+c3qM
Unity (soon updated)
Test Video
Screen Recording 2024-02-29 at 5.22.10 PM.mov
Create or Select Your Light Object you wish to control
Create a Trigger Zone: 2 ways
Add Collider on Lighting object
Is Trigger
property to true.Add Collider to an Empty Game Object
You can create a trigger zone by adding a Collider to an Empty GameObject and checking the "Is Trigger" option in the Collider component.
I used an empty gameobject and add Box Collider and created a trigger zone.
Create and Attach the Script
LightOnOff
LightOnOff
Code SampleLightOnOff
script to the trigger zone GameObject.Assign the Light Object:
Target Light
in the Inspector where the script component is. Drag your light object from the scene hierarchy into this field to link it with the script.Tag the Player
Test
Test Video
Screen Recording 2024-02-29 at 5.11.54 PM.mov
LightTrigger
Code Sample