Studio › Manual › More tools

Effects on events

An animation event can play particle effects on its frame, by itself: a muzzle flash at the gun's muzzle as the trigger is pulled, a shell flying out of the side, dust at a foot. It works in the 3D view while clips play, in Play and in the game, with no code.

Fire Effects (Room > Animation > Fire Effects…, ⌃⌥⇧⌘F, or the right-click Animation ▸ Fire Effects…): a gun's effects in a click.

  1. Give the character its gun (Hold Item: the built-in Pistol or Rifle, or a Weapons Pack gun).
  2. Its clips need fire events: mark them with Events… (⌃⌥⇧⌘V).
  3. Fire Effects… with the character selected: pick the Muzzle flash, the Shell and, if you like, Smoke (effects of the project: Room > 3D View > Effects), and the clips (every clip with fire events is ticked to start with). Set Up.

Every fire event of those clips then plays the flash and the smoke at the held gun's Muzzle and the shell at its ShellEject, in place of what those points had on those events.

Any event, any effect. In the Events window, click an event, pick an effect and where it plays, press Add Effect (No Effects takes them off), then Save. Where:

  • Held item: Muzzle, ShellEject, Tip, Support, Grip, Magazine, Rack: a point on the item the character holds in a hand (the right hand or both first, else the left). A gun without a ShellEject point gets one worked out on the right of the slide.
  • Bone: …: one of the character's bones (a foot for dust, a hand for a spell).

The list shows each event's effects ("fire → muzzle_flash at held item's Muzzle").

How they play. Each effect starts on the event's frame (once: a looping effect plays one round) and follows its point, turned the way the point is (it rides on the hand's bone where the point was when it started: a weapon put away meanwhile leaves it with the hand, as in the game): the effect's +Z goes along the barrel, +Y up and +X out of the gun's left side, so a shell going -X flies out to the right. Local-space particles (the flash) stay on the barrel; world-space ones (shells, smoke) are left where they were made. In the view they play while the clips play (the play button over the 3D view, or Room > 3D View > Play Animations, ⌃⇧P), held items following their hands frame by frame, and in Play; they go when they've played.

In the game. The effects are written with the model (model.json's events: "fx": [{"effect", "at"}]) and the items' points into datafiles/room3d/holds.json, as Room 3D writes them. The kit plays them as the clip passes the event: an o_r3d_fx burst attached to the character's hand bone at the point (r3d_fx_at_item(effect, item, point) does the same from your own code), before on_anim_event and User Event 14 run. Renaming an effect renames it in the events too. Each change is one undo step.

Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.