Trigger_response exit (not enter) message comes after enter message

I have 2 objects with circle triggers and if mouse moves slowly between them it works fine and “not message.enter” message goes before “message.enter”. But on higher speed GO first gets “message.enter” and only after that it gets “not message.enter”.

So even if cursor is over a trigger, it gets message not to do anything since it got “exit” message last.

Sorry if my post is a bit messy, but hope that image will help.

image

Thanks!

Perhaps you can provide a repro case where we can test this issue?

2 Likes

I’ll try to make separate project for that. Maybe is will make things clearer.

Thanks!

2 Likes

kidkiedis sorry to ask but are you greek? Because I am greek and I see how your name finish and I thought that maybe you are. Thanks and sorry If I disturb

1 Like

Also about trigger response when enter and you put to send a message then will sent it. At exit I think will stop. If I remember well at learn section has an example pretty easy that from there you can implement what you need. Also check how much high is the y value of collider so to do the collision with other object. And check the groups of collisions. Thanks

1 Like

Thanks! Checking docs and examples seems like a great idea.
Temporary solved the issue, but is still needs to be fixed.

Not a greek but somewhere close… I’am russian. =)
Just used Kiedis as addition to my nickname. Guess RHCP was my favorite band back then.

1 Like

Cool continue and I wish you the best with your project. Check mine too at dev diary that called news sim. And tell me if you like. Thanks

2 Likes

Stumbled when googling and thought I’d add my solution to this for anyone else having the same issue.

Basically, the enter event is triggered before the exit event (both game objects have the trigger collisionObject attached).

Say I have a Ball game object that has entered into collision with Target A. There is also a Target B, and has just enough space so the Ball game object must exit Target A before it can collide with Target B.

Now say, via dragging the Ball game object away from Target A into Target B quickly will trigger the enter event first on Target B, then the exit event is triggered from Target A.

This is a problem if you want to run your logic in the order of exiting Target A, and entering Target B.

To solve this problem, in enter event, I have wrapped the game logic in a timer so it will run on the next frame. Seems to be working fine so far.

Example:
timer.delay(0, false, function(self) onDragEnd(self) end)

Any advice to this solution appreciated.

1 Like