Skip to content
Shaye Garg edited this page Oct 3, 2021 · 4 revisions

Events let you trigger sounds and effects at certain points in an animation.

event also uses some inbuilt structs and enums, which are declared:

// A direction along an animation.
enum Direction {
    Forward, // Trigger when the animation value is increasing
    Backward, // Trigger when the animation value is decreasing
    Both // Trigger on both conditions
}
// An event during an animation
struct Event {
    time: num, // The normalized (0 - 1) point during the animation
    direction: Direction, //  The direction at which to trigger the event
    sounds: [str] = [none], // The Wwise Events to play when the Event is triggered
    effects: [str] = [none] // The effects to play when the Event is triggered
}

You can create events like:

events <name: expr> = <events: expr>
// Which would be:
events name = [
    Event {
        time: 0.1,
        direction: Direction.Forward,
        sounds: [
            "MySound",
            "SomeOtherSound"
        ]
    },
    Event {
        time: 0.5,
        direction: Direction.Forward,
        effects: [
            "ElevatorPuffEffect"
        ]
    }
]

name: The name of the animation to trigger the Events on.

events: An array of Events.

Clone this wiki locally