YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
21 stars 8 forks source link

Collision leave event #3047

Open jack27121 opened 1 year ago

jack27121 commented 1 year ago

Is your feature request related to a problem?

having a trigger object is useful. It would usually be something like this, in a step event

/// @description callback is executed when player enters it
if (place_meeting(x,y,obj_player))
{
    if (triggered == false)
    {
        callback()
        triggered = true;
    }
}
else triggered = false;

using the collision event would be more useful though, but you can't check for when the collision stops. And so you can't reset the trigger afterwards, unless you're using the step event, or alarms anyway.

Describe the solution you'd like

If there existed a collision leave event. Then that would make using collision events more useful in many tasks, and in turn make the games more optimized

Describe alternatives you've considered

you could reset the states with an alarm, but i still believe a collision leave event would have many more use cases than i can think of

Additional context

GameMaker_Cv18Z06jzE

rwkay commented 1 year ago

what would a collision_leave event do? I am confused as to what this would actually require and how it would be used?

DragoniteSpam commented 1 year ago

presumably the same thing as this: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnCollisionExit.html

jack27121 commented 1 year ago

what would a collision_leave event do? I am confused as to what this would actually require and how it would be used?

When a collision event is triggered. Then it stays triggered until whichever object leaves. It is the point that it stops being triggered that the collision leave/exit should trigger.

Thinking about it more, these would all be useful

I've heard tell of some trigger system being worked on, i don't know if that encapsulates all this

rwkay commented 1 year ago

Yes this is describing the Trigger system that we have planned (it will be New Runtime and next year before we deliver it)