Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Use sound effects to improve the user’s experience of an equippable.

Make effect Prefabs

Create a set of Prefabs for each sound effect. Making these into Prefabs will allow you to easily re-use these effects. Do this by adding the Play Sound Effect script to the Prefab and adding however many clips you like. The player will randomly choose a sound from this list when it plays.

Attach effect Prefabs to the Equippable

Attach these Prefabs as children of the Equippable.

Connect events to the effects

Now we want to wire up the Equippable so that various events can trigger these sounds. Most Motive components have a set of events that you can attach to.

Picking Up

Connect the Grabbable “On Grab Begin Event”

Equip/Unequip

Connect to the Equippable “On User Equip” and “On User Unequip” events. (Note that this is slightly different from “On Equip”--”On User Equip” only fires when the user takes an action to equip as opposed to the item being equipped automatically by a Script.)

Drop

To handle effects when an item hits the ground, you’ll need to add a Collision Event Hanlder script to the object. This component fires events when the object processes a collision. Set a threshold so that the sound effect only plays when the collision has a certain force (otherwise you will notice any disturbance causes the event to fire). Attach to the “Collision Enter” event.

  • No labels