The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
Legacy:Making Glass Break
Exploding Glass... What?
You can simulate real exploding glass in UnrealEd very easily. I will explain this step by step. It is a lot like exploding walls.
Note: The BreakingGlass actor used in this guide is only available in UT. Starting with UT2003 Emitters can be used instead to create far better glass breaking effects. See the Breaking Glass UT2003 for that.
- Find a place you want your glass to go. (Hopefully a windowframe)
- Create a mover that is 2 units thick and 2 units thinner than your area you wish to put it in. Set its key 1 to outside the level and key 0 in its normal position.
The minus 2 units of glass is used to avoid BSP holes when you can see through the edges of the glass. (A lot of mappers forget this and it shows up)
- Texture the mover with something glassish. There is good textures in the Coret package. Make sure you set it to translucent in the Surface Flags (UT).
- Add an Actor >> Effects >> ExplodingWall >> BreakingGlass in the middle of your glass mover. For "respawning" glass you should use the custom RetriggerableBreakingGlass actor instead.
- Set the following properties of the mover:
- Mover -> bDamageTriggered = True
- Mover -> bTriggerOnlyOnce = True (False for respawning glass)
- Mover -> DamageThreshold = 1
- Mover -> MoveTime = 0
- Object -> InitialState = TriggerToggle (for one-shot breaking)
Object -> InitialState = TriggerOpenedTime (for respawning glass)
- Mover -> StayOpenTime = 30-60 (only for respawning glass, number of seconds to wait after breaking)
- Set the following properties of the BreakingGlass actor:
- Collision-> bCollideActors = False (this makes sure projectiles really hit the glass mover, not the BreakingGlass actor)
- Effects -> bOnlyTriggerable = True
- ExplodingWall -> bTranslucentGlass = True
Alright so you're done now. When you shoot the glass mover with anything that does over 1 damage (basically everything) then it will instantly move out of the level and trigger the actor to display glass shattering and making noise.
- Exploding projectiles not only break the window they hit, but also others nearby
- Make sure the glass mover's pivot point is right in its center. Also, if you failed to disable the BreakingGlass actor's collision, the projectile's explosion center might be far enough out from the wall to "see" other glass movers as well.