GMS 2.3+ (solved) What is happening here with event_user(0)?

jb skaggs

Member
Struggling with getting my memories back after chemo- its like starting over. Anyways... In the code below from a example I installed to study I found this event_user(0).

GML:
with(objUnit) {
    target_x = get_snapped(mouse_x, CELL_SIZE) + CELL_SIZE / 2;
    target_y = get_snapped(mouse_y, CELL_SIZE) + CELL_SIZE / 2;
    target = instance_position(target_x, target_y, CLICKABLE_CELL);
    event_user(0);
}
Nowhere else in the game files or scripts is it called or referenced.

The game manual just said it was a user created event.


So what is it doing?

thanks
 
In addition to the usual events in objects (Create, Step, Destroy, etc...) you can also define your own events which are called with this function. objUnit should have a User Event 0 event with code to perform.
 
Top