GMS 2 How do i trigger something on Spine Event?

Discussion in 'Programming' started by MadPropz101, Mar 6, 2018.

  1. MadPropz101

    MadPropz101 Member

    Joined:
    Jan 25, 2018
    Posts:
    122
    I have made an event in my Spine animation, and want to play a sound in gamemaker when the event is triggered, i'm having trouble finding info on the subject.
     
  2. MadPropz101

    MadPropz101 Member

    Joined:
    Jan 25, 2018
    Posts:
    122
    I just figured it out, it goes something like:

    var get_event = event_data[? "name"];

    if (get_event == "step")
    {
    audio_play_sound(snd_Step, 1, false);
    }

    Wish there was a more efficient way of doing this, hopefully YoYo adds a spine event function with the new update.
     
  3. orbis

    orbis Member

    Joined:
    Aug 28, 2018
    Posts:
    1
    Code:
    var evName = event_data[? "name"];
    var evTrack = event_data[? "track"];
    var evInt = event_data[? "integer"];
    var evFloat = event_data[? "float"];
    var evString = event_data[? "string"];
    
    show_debug_message("Name  : " + evName);
    show_debug_message("Track : " + string(evTrack));
    show_debug_message("Int   : " + string(evInt));
    show_debug_message("Float : " + string(evFloat));
    show_debug_message("String: " + evString);
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice