Exercise 13: A ground slam that throws rubble
Purpose. To throw chunks of rubble outward from a point, have them land and settle on the floor, and puff dust where each one lands.
Sparks pass through the floor. Rubble must not: it has to arc, hit the ground, bounce once or twice, and lie still. The Rocks emitter does that. It is made with Transform as, like the Camera Shake of Exercise 11 and the Lightning of Exercise 12.
Before starting
Section titled “Before starting”- The workspace has a floor that parts can collide with.
- One new Part named
Rubblesits a little above the floor, with Size2, 2, 2, Material Slate and a grey colour. Every chunk will be a duplicate of this Part. - The
Sparksemitter from Exercise 12 is in the workspace. It will serve as the dust.
Procedure
Section titled “Procedure”Steps 1, 2, 7 and 8 repeat earlier exercises.
| Step | Control | Action | Result |
|---|---|---|---|
| 1 | Rubble | Select. Press ▾ beside Transform, then Transform as Rocks. | Rubble turns invisible. The Emit box reads 1. |
| 2 | HUD ▸ Emit button | Press | Between six and ten chunks of different sizes hop about 2 studs into the air, fall, and come to rest on the floor. Near the end of their three seconds they sink into the floor and are gone. |
| 3 | Properties ▸ Motion ▸ Launch Speed | Enter 50, 80 | No change yet. |
| 4 | Properties ▸ Spawn ▸ Burst Mode | Set to Ring | No change yet. |
| 5 | Properties ▸ Motion ▸ SpreadAngle | Enter 30 | No change yet. |
| 6 | HUD ▸ Emit button | Press | The chunks leave in a ring, evenly spaced around Rubble, thrown outward and 30 degrees upward. Each rises between about 1.5 and 4 studs, lands some way off, bounces, slides, and lies flat on one face. |
| 7 | Properties ▸ Events ▸ On Hit | Expand Events. Switch On Hit on. | The rows of the On Hit block appear. |
| 8 | On Hit ▸ Emit ▸ … | Press. Click Sparks. Press Set. | The Emit row shows the path to Sparks. |
| 9 | HUD ▸ Emit button | Press | One burst of sparks goes off, at the spot where the first chunk lands. |
| 10 | Properties ▸ Motion ▸ Hit Per Chunk | Switch on | No change yet. |
| 11 | HUD ▸ Emit button | Press | Every chunk throws its own burst of sparks where it first lands. |
What the steps did
Section titled “What the steps did”A Rocks emitter throws a burst of chunks. One particle is one whole burst, so an Emit count of 2 means two bursts. Each chunk is a duplicate of the Part, at a size of its own.
| Row | Starts at | What it sets |
|---|---|---|
| Spawn ▸ Chunks | 6, 10 | How many chunks are in a burst. At most 32. |
| Spawn ▸ Chunk Scale | 0.5, 1.5 | The size of each chunk, as a multiple of the Part’s size. A 2 stud Part gives chunks from 1 to 3 studs. |
| Spawn ▸ Burst Mode | Directional | Directional throws every chunk the same way, spread by SpreadAngle. Ring spaces the chunks evenly in a circle and throws them outward. |
| Motion ▸ Launch Speed | 30 | How hard each chunk is thrown, in studs per second. |
| Motion ▸ Gravity | 196.2 | The downward pull, in studs per second per second. This is Roblox’s own gravity. |
| Motion ▸ Bounciness | 0.3, 0.5 | The share of its speed a chunk keeps at each bounce, from 0 to 1. |
| Motion ▸ Sink Out | On | Chunks at rest sink into the surface under them at the end of the burst’s life. |
| Motion ▸ Hit Per Chunk | Off | Off, On Hit fires once per burst, at the first landing. On, it fires once for every chunk. |
Gravity here is strong, so a throw goes less far than the number suggests. Thrown straight up at 30 studs per second, a chunk rises about 2.3 studs. At 80 it rises about 16.
In Ring mode, the first number of SpreadAngle is the angle of the throw above the flat: 0 is flat outward, 90 is straight along Direction.
The event at steps 7 and 8 is the same On Hit as in Exercise 12, picked the same way. For Rocks it fires when a chunk first touches a surface.
If the result differs
Section titled “If the result differs”| Symptom | Cause | Action |
|---|---|---|
| The chunks fall through the floor | The floor has CanCollide off. | Switch CanCollide on for the floor. |
| The chunks barely leave the ground | Launch Speed is still 30. | Repeat step 3. |
| The chunks vanish without sinking | Sink Out is off. | Switch it on, or fade them with a Transparency graph. |
| No sparks at all | The chunks did not touch anything, or the On Hit block has no emitter picked. | Repeat step 8. |
| The chunks lie about but no rubble remains afterwards | Sink Out removes it. | Switch Sink Out off and raise Lifetime or Linger. |
Variations
Section titled “Variations”| Change | Result |
|---|---|
| Motion ▸ Inherit Floor on | Each chunk takes the material and colour of the part it lands on, so the rubble matches the floor. |
| Transform a MeshPart rock in place of the block | Every chunk is that mesh, at a size of its own. |
Motion ▸ Gravity 60 | A slow, floating throw. |
Emission ▸ Timescale -1 | The burst plays backwards. The chunks start at rest and fly back together. |
Motion ▸ Tumble 0 | The chunks fly without spinning. |
Burst Mode Directional, Direction Front, SpreadAngle 15 | Debris sprayed one way, as from a wall struck from behind. |
| New in this exercise | Transform as Rocks. Burst Mode. Launch Speed. Hit Per Chunk. |
| Done before | Transform as (Exercises 11 and 12). SpreadAngle (Exercises 2, 4, 9 and 10). The On Hit event and its picker (Exercise 12). The Emit button (seven times). |
| Carried forward | Nothing. |