Forum rules - please read before posting.

Player moves/slides slightly when interacting with "Walk To Marker" hotspots

edited March 2019 in Technical Q&A

For my hotspot interactions where I have checked "Walk To Marker" as Player action, when the player interacts with those hotspots, he walks to the marker and then he moves/slides quickly into a slightly different position before carrying out the Actionlist associated with the interaction.

I didn't notice it before I implemented a "Use" animation (simple one-frame animation where the player stretches out his hand - using Character -> Animate -> Play custom), because the glitch becomes very pronounced then. It doesn't happen each time, but seems to be related to where the player was standing before ordered to interact with the hotspot. I'm not totally sure if it happens without the Animate action, but it might be happening very subtly sometimes without it as well (I think I saw it once, but haven't been able to reproduce it since).

The "Use" animation sprite is the same size as all the other sprites I'm using for my player, so it shouldn't have anything to do with that. I thought at first the glitch might be related to the hotspot's marker being too close to the edge of the Navmesh, however this doesn't seem to be the case, as it still happens if I make a lot of space in the Navmesh around the marker. I think this glitch is resembling a problem I had earlier, where it turned out I had accidentally placed an element with a collider on it, which made the player slide off the collider. However, as far as I can see this isn't the case here.

I'm using AC v1.66.8 and Unity 2018.2.10f1.

What could be causing this problem?

Comments

  • A screencast or series of screenshots to illustrate what you mean would be very helpful here - this is a visual problem and it's difficult to understand your meaning without seeing it.

    Does this occur if, after running the interaction normally, you re-run the Interaction ActionList by clicking "Run now" in its Inspector?

    Though you've ruled out this being sprite-related, the first thing I'd check is that the sprite's pivot point is in the same position as the regular idle animation (i.e. in between the character's feet). If the "use" sprite is wider than normal, you may need to adjust the pivot point to keep the character visually in the same place.

    Otherwise, what are the effects of checking "Retro-mode pathfinding" in the Player's Inspector?

  • edited March 2019

    I was initially using 'Retro-style movement', but now I tried switching it off, and I can see that the problem doesn't seem to occur when I have it switched off. I have now tweaked the acceleration and deceleration parameters to resemble the retro-style movement, so it's probably easier to just stick with this.

    However:

    As for the sprites, all the sprites used for my character are exactly the same size and have the same pivot point.

    The strange movement (when retro-style movement is switched on) doesn't occur when re-running the interaction from the inspector.

    When I have retro-style movement switched off my character still sometimes makes a minor adjustment to his position (i.e. he walks a tiny bit) when interacting with a hotspot, and I think this is related to the hotspot walk-to marker. The majority of the times this happens is when he has just interacted with a hotspot, and then while still standing in the same place is ordered to interact with the same hotspot again. So it probably has to with the movement accuracy in relation to walking to the hotspot's walk-to marker. Is it possible to avoid this? I already have the destination accuracy cranked down to 0 in Game Editor Settings.

    (The problem I had before switching off retro-style movement was probably the same, only looking weirder with retro-style switched on.)

    Here is a video clip of how it looks now:

    https://vimeo.com/325231269

  • Retro-mode is best suited for pixel-art games, and should be left checked.

    What about the scale of your sprites? How does your player sprite compare with Brain2D, physically speaking?

  • Ah okay, I'll switch back to retro-style then.

    I'm not completely sure what you mean by 'physically speaking', but I can see that the Brain2D idle down sprite is 180x324px, whereas my sprite is 100x110px.

    But whereas Brain2D is set to 100 pixels per unit, mine is set to 1 pixel per unit, because this setting makes it easier to make my backgrounds pixel perfect. This of course means that my scenes and my character are extremely large relative to Unity's physical space. Can this be affecting my character's movement?

  • Can this be affecting my character's movement?

    I'd imagine so. I was referring to the size of your player sprite compared with Brain's when both placed in the scene. Both Unity and AC are designed with this scale in mind - with the "Destination accuracy" slider used to account for differences (though perhaps not too major as yours).

    Is a PPU of 1 necessary for pixel perfection? It doesn't seem necessary when using Unity's Pixel Perfect Camera - see this guide. @zebbi has also written up a guide on using PPC with AC on the wiki.

  • It's actually not that I need the game as such to be pixel perfect, but I found that if I set all my sprites to 1 pixel per unit I could easily move them 1 pixel at a time when snapping to the grid. Of course I didn't take into account that this could cause a problem for AC.

    I'll try switching back to a more normal scale and see if this solves my problem. Thanks!

  • After scaling down my sprites I haven't experienced the problem, so that seems to have done it. Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.