0

I am making a simple MOBA game. I have implemented AABB swept collision detection for player and projectile movement and it works well. It works by computing time of intersection, so the AABBs never actually penetrate.

Now I'm thinking about how to support a Blink/Flash/teleport ability, allowing the player to instantaneously move to another location. Now there can be penetration if the player teleports into a wall, and I'm looking for a good way to resolve collision.

Here is a video from the game Brawl Stars showing how I'd like it to respond when teleporting into walls. You can see that when teleporting over walls of different thickness, if the wall is thicker than the distance the player would teleport, the collision gets resolved nicely, shunting them off to the side (0:18) or in the direction they were going (0:15) if there is enough distance left, or not allowing them to move at all (0:29).

It seems there is some way of finding the closest tile to where the player would end up at, and they get moved there instead. Is that what is going on?

If not, can swept collision detection be extended to handle this? I would guess not, in that case, how can it be done?

This is more of a conceptual question, for the general approach. I don't have any working code yet.

user1953221
  • 173
  • 5

0 Answers0