You are on page 1of 5

UNREAL DEVELOPMENT KIT

13h - Kismet Part 8 - Triggered Material Instance Changes

Using Kismet, triggers and Material Instant Constants are a quick and easy way to perform visual tricks such
as turning on lights, using buttons with screens, and the like. It will enable us to use one model, one Material
Instance, and a small amount of Kismet to alter appearances.

SCENE SET-UP

1. Create a new level, using the Night Lighting.

2. Open your Content Browser and search Static Mesh models for S_LT_Light_SM_Light01. Place it in your
scene right in front of the box located in the middle of the scene.

3. In your Content Browser double-click the light model and locate the Material used for it. Make a copy of
this in your Kismet_Examples package and name it Light_01_Mat. This will enable us to edit without
harming the original material in UDK.

4. Double-click to open this new Light_01 material. Disconnect (do not remove) the EMISSIVE sequence from
the main material and slide its entire string to the right to make some room.

Hold M and left-click to add a Multiply and then hold 1 and add a New Constant variable. With the
Constant selected, right-click on it and choose Convert to Parameter. In its Properties change the
Parameter Name to LightState. This is the name we will refer to later. Also, make sure its Default Value is 0.

Wire it up like this, then save it and close the Material:

5. Right-click this material in your package and select Create New Material Instance (Constant). Keep the
name it suggests.

Double click to open this Instance and open the section Scalar Parameter Values and you should see
LightState there. Check the box in front of it and change the 0.000 to 1 and you should see the material
change to appear like the light is on. Set it back to 0 and close the material window.
6. About 10 feet or so back from the light on the ground, right-click and place a Trigger in the scene. Open its
properties and in the Visibility rollout uncheck the box that says Hidden. This will make it visible on the
screen so we know where it is.

7. Open up the Content Browser again, go to the Actor Classes tab, and
under the Uncategorized section locate and select
MaterialInstanceActor. Right-click on your scene and add this so
it is right above the light on the ground (right).

8. Make sure that the new Material Instance you created is applied to
both the light model and to the MI icon on your screen.

9. Open Kismet. With the Trigger selected on your screen, right-click and add a New Event Using Trigger_0
Used. Make sure you uncheck Aim to Interact in the Properties and set the Max Trigger Count to 0.

10. Select the MI icon on your screen and in Kismet right-click and add a New Matinee.

Double-click and open the Matinee and Add New Empty Group. Name it MISwitch. Now right-click the
MISwitch group and create an Add New Float Material Param Track. In the Properties below make sure
the Param Name says LightState. This is the name in our Material Instance we added.

Make sure the length of the animation track is set to 1.0 because that’s
all we need to change the material instance from off to on.

Notice there are no keyframes already added. With the black bar at 0.00
hit the enter key to add a keyframe. Move the bar to 1.0 and do the same.
Now, right-click the red triangle keyframe at 0.00 and choose Set Value.
Make sure it is set to 0 and click OK.

Do the same thing for the key frame at 1, making sure the Set Value says
1.0. Scrub the black bar back and forth and look at your scene and you
should see the light going on and off. When you close it it should like this
on the right.
11. Wire the Trigger to the Matinee Play and check out what happens. The light goes on, but that’s it. What if
we need it to go on and off?

Right click and add a New Action > Switch > Switch. In the Properties make sure you change the Link Count
to 2 and check the box that says Looping so we can do this multiple times or it will only work once.

12. Wire the Switch to the Trigger. Wire Link 1 to the Matinee Play node and Link 2 to the Reverse node. See if
it works better.

13. Last trick is to add some sound. In the Content Browser locate the sound A_Powerup_Berzerk_Ground-
LoopCue. Add a Play sound and wire Play to Link 1 and Stop to Link 2.

That works pretty good, but the problem is the sound starts and stops before the light does. In the Play
Sound Properties make these changes:

Fade In Time - 0.35


Fade Out Time - 0.5
Volume Multiplier - 0.5

Try it again. It works pretty sweet.

Like all other Kismet tutorials, this is a simple set-up designed to let you see the capabilities of how this works.
You may be able to think of a variety of ways of incorporating this, or similar, effects into your own scene.

You might also like