Skip to content

actions.moveBy gets Actor stuck on fixed collision objects #2510

Answered by AWaselnuk
DaVince asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  // 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?

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@DaVince
Comment options

@eonarheim
Comment options

@DaVince
Comment options

@DaVince
Comment options

Answer selected by DaVince
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants