-
Hi, I've been using actions to move my character tile by tile in an animated fashion. It's looked nice so far, but now I'm taking the next step and adding fixed collision objects to the game and the player actor always gets irrevocably stuck as soon as it touches the object. A reproduction can be found here: https://github.com/DaVince/excalibur-bugs/tree/action-gets-object-stuck/src The sword gets stuck as soon as it walks into the red box object. Unfortunately, practically speaking, this means I cannot use a solid Tiled layer and Actions for character movement at the same time... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm 100% not sure if this is a good idea (I'm new to game dev + Excalibur) but during prototyping I encountered the same issue because I was just using mouse clicks to have a player The code that fixed it for me was this: // clear actions when player collides with something
player.on("postcollision", (evt) => {
player.actions.clearActions();
}); Of course this approach made my movement feel pretty rough, but if you are building a gridded, tile-by-tile system this might work fine? |
Beta Was this translation helpful? Give feedback.
I'm 100% not sure if this is a good idea (I'm new to game dev + Excalibur) but during prototyping I encountered the same issue because I was just using mouse clicks to have a player
moveTo
things.The code that fixed it for me was this:
Of course this approach made my movement feel pretty rough, but if you are building a gridded, tile-by-tile system this might work fine?