addBoxTrigger

API -

function yourEvent(user, object, eventType)
    if user ~= nil then
        if eventType == 'enter' then
            log(user.displayName .. 'entered');
        end
        if eventType == 'exit' then
            log(user.displayName .. 'exited');
        end
    else
        if eventType == 'mouseEntered' then
        end
        if eventType == 'mouseExited' then
        end
        if eventType == 'mouseDown' then
        end
        if eventType == 'mouseUp' then
        end
     end
end

return function()
    local app = getApp();
    local myObject = app.createGameObject();
    wait(3);
    myObject.physics.addBoxTrigger();
    app.addEvent('triggerObject', 'yourEvent');
    keepAlive();
end

Last updated