How do I fix frame perfect events?

I have events that can happen on the same frame and cause issues.

Game Example:
You are hit at the same tick as triggering invulnerability, killing you. This happens during a dash where I disable collision to run through enemies, so I die in the dash causing me to fall down through the map.

How do fix this from happening? I’m assuming there’s a way to give certain things priority if they are triggered at the same time.

I’m sure there’s information on this out there, but I haven’t figured out what to search to actually find this info anywhere. Any help would be appreciated, thanks!

You can ( I think, still ) set which part of the frame things run in. It’s called tick group

1 Like

Good to know about this, as I didn’t before. This sets it to the entire actor though, not just a function from my understanding. Is this normally done by changing the tick group when executing something to be a different, and then changing back once the action is completed? Just wanted to make sure that’s a normal workflow before I start doing something completely wrong. :smiley:

1 Like

I can’t actually recall exactly how it works :smiley:

But your AI is one actor, and the player another. That’s enough right?

Best to experiment and check some vids :wink:

Thanks to you I have managed to find the path to what I think is the solution: “Add Tick Prerequisite Actor”. I have given my enemies the prerequisite of the player, so now they trigger after the player. So thank you for your help!

1 Like

Ah, nice :smiley:

You could also just queue actions in your events rather than processing them. Then, you can process them in your tick, in the order you want. That way, you will have consistent processing orders in events.

I didn’t realize that was possible. Interesting, I’ll try to find information about this. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.