Get 1Click Maker

HUD-to-Object Commands โ€‹

Texture, color and position actions reach a target directly. But a target cannot play a sound, animate itself (animesh) or run a timer on request from the outside. For that, the target gets its own project and the HUD sends it commands.

We will build a HUD that makes an animesh dog sit, stand and bark.

You need: the dog (animesh, with animations dog_sit, dog_stand and a bark sound inside), and a HUD with three prims named sit, stand, bark.

Part A: the dog's project โ€‹

  1. Rez the dog. Drop in: *TARGETS (choose NEW), *BUILD, *FUNCTIONS, [add-on] - Events - 1Click.

  2. Open the dog's panel link from chat. Assets โ†’ Search for assets to load its animations and sound.

  3. Register three Receive Command events: sit, stand, bark.

  4. Actions:

    • sit โ†’ Object Animation Stop all and start dog_sit
    • stand โ†’ Object Animation Stop all and start dog_stand
    • bark โ†’ Sound Play bark, volume 80
  5. Build. (Keep this tab open; you will Finish it later.)

Part B: the HUD's project โ€‹

  1. Rez the HUD with *BUILD and *FUNCTIONS. Open its panel.

  2. Re-scan buttons; Targets โ†’ Search for targets (the dog is listed).

  3. Create the three button functions, each with one Send Command: Target = the dog, Command = sit / stand / bark.

  4. Build. Click the buttons: the dog obeys.

Finish both โ€‹

Press Finish! in each project. Both objects keep their *FUNCTIONS; the dog keeps its animations in Content (Finish never deletes animations), and the sound keeps working by UUID even though the sound file itself is removed.

Diagram โ€‹

text
HUD (project A)                       Dog (project B)
btn "bark" โ†’ Send Command "bark" โ”€โ”€โ”€โ–บ Receive Command "bark" โ†’ Sound "bark"

Tips โ€‹

  • Commands are just names. For values (speeds, colors), use several commands or combine with variables on the receiving side.
  • The dog also works on its own: give it buttons or an Attach/Rez event.
  • Several HUDs can command the same object, and one HUD can command many objects (one Send Command action per object).
  • Both objects must belong to the same owner and be in the same region.