Search public documentation:
- Create a simple level - just a large floor with a PlayerStart and a PointLightToggleable.
- Enable dynamic light on the PointLightToggleable actor (properties>Light>bForceDynamicLight=true).
- Drop a trigger in the world and set it to not be hidden (properties>Advanced>bHidden=false).
- Select the light, and open the UnrealKismet workspace by clicking the K icon in the toolbar.
- Right click in the Kismet workspace and create an object variable by selecting the 'New Object Var Using Selected Actor' menu option (Selected Actor will be replaced with the name of the selected actor). You should now see the icon for a light inside the object variable, along with the unique name of the light.
- The next step is to attach an event to the Trigger. Select the Trigger in the main editor window.
- Right click in the Kismet workspace and create a Touch event by selecting the 'New Event Using Trigger_0'. This is context sensitive, so you will only see events that a Trigger supports. In the 'Create Event' submenu, select the 'Touch' option to create a Touch event for Trigger_0.
- The next step is to assign give the event an action to execute. Right click in the Kismet workspace, and select the 'NewAction -> Toggle -> Toggle'.
- Drag a line from the 'Touched' output on the Touch event to the 'Toggle' input on the Toggle action. You'll notice the Toggle action has a purple node on the bottom labeled 'Target'. The inputs and outputs for components in Kismet are all color coded according to the variable type that can be used with them. In this case, Target is purple, so an object variable is needed.
- In this case, we want to connect the target to the light object variable by dragging a line from the 'Target' node to the object variable that we created which contains the light. This will cause the Toggle action to turn the light on or off every time it is activated. If you only wanted to turn the light on or off, you would only connect to the input associated with that action.
- Almost done. Select the Touch event and look at the property editor below. Since we want to be able to turn this on and off more than once, set the MaxTriggerCount to 0, which is equivalent to there not being a limit.
- Also set the ReTriggerDelay to a small value, such as .1, to avoid possibly triggering the event twice quickly.